Re: enumerated type..

From: Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar>
To: "raptor(at)tvskat(dot)net" <raptor(at)tvskat(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: enumerated type..
Date: 2004-07-19 13:53:45
Message-ID: 1090245225.976.12.camel@taz.oficina
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)tvskat(dot)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(at)postgresql(dot)org)
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Damon Hart 2004-07-19 14:17:09 special table queries slow until dump/restore
Previous Message Tom Lane 2004-07-19 13:46:02 Re: Question on INSERT statement