From: Peter Eisentraut <peter_e@gmx.net>
To: Kyle Bateman <kyle@actarg.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] ENUM Type
Date: Sat, 4 Mar 2000 18:05:40 +0100 (CET)
Message-ID: <Pine.LNX.4.21.0003040400040.489-100000@localhost.localdomain> (raw)
In-Reply-To: <38C030AC.6C69BD01@actarg.com>
Kyle Bateman writes:
> Does PostgreSQL have support for an ENUM type?
No. You can create a separate table that maps some, say integer, key to a,
say, string. That's usually how ENUM stuff is ported away from MySQL (also
known as TheirSQL). Alternatively you can also pull something like this:
CREATE TABLE test (
...
a text check (a in ('value1', 'value2', ...)),
...
)
You get the idea.
> I didn't see it in the docs, but maybe someone has figured out how to
> create one easily with the add new type stuff...
That "add new type stuff" isn't all one might think it is either.
--
Peter Eisentraut Sernanders väg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden
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: peter_e@gmx.net, kyle@actarg.com
Subject: Re: [SQL] ENUM Type
In-Reply-To: <Pine.LNX.4.21.0003040400040.489-100000@localhost.localdomain>
References: <38C030AC.6C69BD01@actarg.com> <Pine.LNX.4.21.0003040400040.489-100000@localhost.localdomain>
* 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