Re: enum

From: Rod Kreisler <rod(at)23net(dot)net>
To: "Adler, Stephen" <adler(at)bnl(dot)gov>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: enum
Date: 2002-11-30 18:22:02
Message-ID: JNEGKNDJGBKLBDGPOPFOEEBLDFAA.rod@23net.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org
> [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Adler, Stephen
> Sent: Saturday, November 30, 2002 1:17 PM
> To: Rod Kreisler
> Cc: pgsql-novice(at)postgresql(dot)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

In response to

  • Re: enum at 2002-11-30 18:17:25 from Adler, Stephen

Browse pgsql-novice by date

  From Date Subject
Next Message Jon Williams 2002-11-30 18:54:44 Missing Data Directory
Previous Message Adler, Stephen 2002-11-30 18:17:25 Re: enum