[GENERAL] Non-check constraint def for a static list ?

2009-09-15 Thread Gauthier, Dave
Hi: How could I define a constraint on a colum who's value I want to restrict to a static list of strings? For example, a column colled gender which cannot be NULL and must be either 'M' or 'F'. I can do it with a check constraint, but I can't defer those constraints (the reason I'm asking

Re: [GENERAL] Non-check constraint def for a static list ?

2009-09-15 Thread Sam Mason
On Tue, Sep 15, 2009 at 08:01:19AM -0700, Gauthier, Dave wrote: How could I define a constraint on a colum who's value I want to restrict to a static list of strings? For example, a column colled gender which cannot be NULL and must be either 'M' or 'F'. I can do it with a check constraint,

Re: [GENERAL] Non-check constraint def for a static list ?

2009-09-15 Thread Grzegorz Jaƛkiewicz
CHECK( foo IN ('bar1', 'bar2')); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Non-check constraint def for a static list ?

2009-09-15 Thread David Fetter
On Tue, Sep 15, 2009 at 08:01:19AM -0700, Gauthier, Dave wrote: Hi: How could I define a constraint on a colum who's value I want to restrict to a static list of strings? For example, a column colled gender which cannot be NULL and must be either 'M' or 'F'. I can do it with a check