Re: enumerated type.. - Mailing list pgsql-general

From Franco Bruno Borghesi
Subject Re: enumerated type..
Date
Msg-id 1090245225.976.12.camel@taz.oficina
Whole thread Raw
In response to enumerated type..  ("raptor@tvskat.net" <raptor@tvskat.net>)
List pgsql-general
CREATE DOMAIN is the answer:

CREATE DOMAIN mytype AS INT2 CHECK(VALUE>=1 AND VALUE<=6);

On Mon, 2004-07-19 at 10:43, raptor@tvskat.net wrote:
hi,

Is it possible in Postgre to have enum type,  so that later table fileld get values from 1-6 (saving space)

1 - statex
2 - stateY
3 - stateZ

something like that and then constrain on this enum type..

tia

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question on INSERT statement
Next
From: Damon Hart
Date:
Subject: special table queries slow until dump/restore