From: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: ENUM like data type
Date: Thu, 30 Jun 2005 10:01:49 +0200
Message-ID: <ED4E30DD9C43D5118DFB00508BBBA76EB167B3@neptun.sonorys.at> (raw)
|> > 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
|
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: robert.koepferl@sonorys.at
Subject: Re: ENUM like data type
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB167B3@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB167B3@neptun.sonorys.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox