Re: How to modify ENUM datatypes? - Mailing list pgsql-general

From Andreas 'ads' Scherbaum
Subject Re: How to modify ENUM datatypes?
Date
Msg-id 20080423123848.7a91184c@iridium.wars-nicht.de
Whole thread Raw
In response to Re: How to modify ENUM datatypes?  ("D. Dante Lorenso" <dante@lorenso.com>)
Responses Re: How to modify ENUM datatypes?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List 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 by date:

Previous
From: Tim Tassonis
Date:
Subject: initdb in 8.3
Next
From: Richard Huxton
Date:
Subject: Re: initdb in 8.3