Re: enum

Поиск
Список
Период
Сортировка
От Rod Kreisler
Тема Re: enum
Дата
Msg-id JNEGKNDJGBKLBDGPOPFOEEBLDFAA.rod@23net.net
обсуждение исходный текст
Ответ на Re: enum  ("Adler, Stephen" <adler@bnl.gov>)
Список 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 по дате отправления:

Предыдущее
От: "Adler, Stephen"
Дата:
Сообщение: Re: enum
Следующее
От: Jon Williams
Дата:
Сообщение: Missing Data Directory