Re: enum - Mailing list pgsql-novice

From Rod Kreisler
Subject Re: enum
Date
Msg-id JNEGKNDJGBKLBDGPOPFOEEBLDFAA.rod@23net.net
Whole thread Raw
In response to Re: enum  ("Adler, Stephen" <adler@bnl.gov>)
List pgsql-novice

> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Adler, Stephen
> Sent: Saturday, November 30, 2002 1:17 PM
> To: Rod Kreisler
> Cc: pgsql-novice@postgresql.org
> Subject: Re: [NOVICE] enum
>
>
> Thanks Rod,
>
> In other words, table myConstratins contains a list of string
> values, ('blue','red','yellow','whatever'), and the
> 'reference "myConstratins" on update cascade' in the
> constraintColumn definition tells postgres to make sure the
> values put into that column must match one of the strings
> listed in myConstraints. Correct?

Yes.

> I also found the command
> check (constraintColumn in ('blue','red','yellow','whatever'))
> which I think I can replace 'reference "myConstraints" on update
> cascade'. The difference between the two I assume is that the first
> example, I can modify the values of the strings which can be
> insterted into my column, while in the latter, the values of
> the strings are basically fixed. Correct?

Yes.  It's much harder to make changes to the list when you use the IN
constraint.  Also, if you want to change 'yellow' to 'green' it takes many
more gyrations.

>
> Where can I find info on all this? It does not seem to be covered
> in the manuals distributed with postgresql.

It's under "SQL Syntax" - "Create Table"

http://www.postgresql.org/idocs/index.php?sql-createtable.html



pgsql-novice by date:

Previous
From: "Adler, Stephen"
Date:
Subject: Re: enum
Next
From: Jon Williams
Date:
Subject: Missing Data Directory