Re: ENUM like data type

From: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ENUM like data type
Date: 2005-06-30 08:01:49
Message-ID: ED4E30DD9C43D5118DFB00508BBBA76EB167B3@neptun.sonorys.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

|> > I disagree. In several relations (views of the world) one
|needs to have a
|> > hand full of well defined values while
|> > integers or bools are not appropriate and strings are too
|free form.
|> > For example male female or true and false. Whilst the
|second has a well
|> > known type, other things like a telephone number type
|don't have such type.
|> > So a new one should be created instead of (varchar/ xy
|between 4 and 8). One
|> > might argue that new 1:n relations with integrity shall be
|established but
|> > this is in my eyes overkill for a constant number of values.
|> > Also think of schema export without data. These values are
|part of the
|> > schema data but not the schema itself which in this sense is wrong
|>
|> Please, most of this can be done with CHECK(...).
|
|Indeed. A CHECK constraint on a DOMAIN is an ENUM plus some.

Yea, that's what also I currently doing. But using varchars instead of
symbolic values (as int4) is just more efficient.

|
|--
|
|
|---------------------------(end of
|broadcast)---------------------------
|TIP 5: Have you checked our extensive FAQ?
|
| http://www.postgresql.org/docs/faq
|

Browse pgsql-sql by date

  From Date Subject
Next Message Nick Stone 2005-06-30 09:27:42 SQL Query question
Previous Message Dawid Kuroczko 2005-06-30 07:51:35 Re: ORDER records based on parameters in IN clause