Thread: enumeration type?

enumeration type?

From
Tina Messmann
Date:
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 ?

Regards
Tina


Re: enumeration type?

From
Karel Zak
Date:
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