Re: CHECK versus a Table for an enumeration

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: CHECK versus a Table for an enumeration
Дата
Msg-id 20031223005602.GF2752@dcc.uchile.cl
обсуждение исходный текст
Ответ на CHECK versus a Table for an enumeration  (Melanie Bergeron <mbergeron_pg@globeecom.com>)
Список pgsql-general
On Mon, Dec 22, 2003 at 04:37:51PM -0500, Melanie Bergeron wrote:

> I want to know what's better between these 2 solutions :
>
> CREATE TABLE user (
> ...
> user_type   text     CHECK(user_type='Root' OR user_type = 'Admin' OR
> user_type = 'Standard'));
>
> or the following :
>
> CREATE TABLE user_type(
> user_type_id     integer   PRIMARY KEY,
> user_type_desc text);

Check out the second article at
                                        
http://www.varlena.com/varlena/GeneralBits/42.php

It contains some discussion on this issue.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The West won the world not by the superiority of its ideas or values
or religion but rather by its superiority in applying organized violence.
Westerners often forget this fact, non-Westerners never do."
(Samuel P. Huntington)

В списке pgsql-general по дате отправления:

Предыдущее
От: Paul Thomas
Дата:
Сообщение: Re: CHECK versus a Table for an enumeration
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: windows distribution