Re: enumeration type?

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tina Messmann <tina(dot)messmann(at)xinux(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: enumeration type?
Date: 2001-12-18 10:01:19
Message-ID: 20011218110119.C16212@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 18, 2001 at 10:32:21AM +0100, Tina Messmann wrote:
> Hello List,
> is there in PostgreSQL something like an enumeration type or have i to
> use the CREATE TYPE command to build my own enumeration type ?

You needn't enumeration type, you can use more standard CHECK
option in table definition. For example:

CREATE TABLE tab (
y char(1) CHECK(y='A' OR y='B' OR y='C')
);

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bo Lorentsen 2001-12-18 13:36:00 PG sql string -> time_t
Previous Message Martijn van Oosterhout 2001-12-18 09:39:40 Re: querying for specs?