Re: How to modify ENUM datatypes?

Поиск
Список
Период
Сортировка
От Andreas 'ads' Scherbaum
Тема Re: How to modify ENUM datatypes?
Дата
Msg-id 20080423123848.7a91184c@iridium.wars-nicht.de
обсуждение исходный текст
Ответ на Re: How to modify ENUM datatypes?  ("D. Dante Lorenso" <dante@lorenso.com>)
Ответы Re: How to modify ENUM datatypes?
Список pgsql-general
On Tue, 22 Apr 2008 15:45:39 -0500 D. Dante Lorenso wrote:

> Andreas 'ads' Scherbaum wrote:
>
> So, the advice here is "don't use ENUM"?

Yes. You should/can use ENUM for something like 'gender':
male, female, unknown. You don't need to add other values ever (yeah, i
skipped some special cases).

But if you use ENUM for color names (as example), it's easy to imagine
that someone comes around and requests a new color to be added to the
list. Here you should use a lookup table and a foreign key instead.

It always depends on the situation. The real problem is that people
start creating the table with ENUM and "oh, nice, this makes it easy"
in mind. But usually things are not as easy as it looks on first sight,
so they later run into trouble.


Kind regards

--
                Andreas 'ads' Scherbaum
German PostgreSQL User Group

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

Предыдущее
От: Tim Tassonis
Дата:
Сообщение: initdb in 8.3
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: initdb in 8.3