Re: enumeration type? - Mailing list pgsql-general

From Karel Zak
Subject Re: enumeration type?
Date
Msg-id 20011218110119.C16212@zf.jcu.cz
Whole thread Raw
In response to enumeration type?  (Tina Messmann <tina.messmann@xinux.de>)
List 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@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

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

pgsql-general by date:

Previous
From: Tina Messmann
Date:
Subject: enumeration type?
Next
From: Bo Lorentsen
Date:
Subject: PG sql string -> time_t