Re: What is the good equivalent for ENUM ?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PgSQL General ML <pgsql-general(at)postgresql(dot)org>
Subject: Re: What is the good equivalent for ENUM ?
Date: 2003-09-03 23:57:57
Message-ID: 1062633477.7340.439.camel@haggis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2003-09-03 at 18:05, Bruce Momjian wrote:
> Ron Johnson wrote:
> > On Wed, 2003-09-03 at 09:50, Vivek Khera wrote:
> > > >>>>> "SD" == Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in> writes:
> > >
> > > SD> On 3 Sep 2003 at 14:30, Bruno BAGUETTE wrote:
> > > >> The problem is that this MySQL database uses ENUM, do you see what can I
> > > >> do to migrate ENUM into PostgreSQL ?
> > >
> > > SD> varchar with check constraints. Add constraits to allow only
> > > SD> certain values of varchar string.
> > >
> > > I used to do this. It turns out to be horribly inflexible when you
> > > need to alter the enum values since the constraints cannot easily be
> > > changed.
> >
> > It'll be better when domains have alterable constraints. Your
> > way is the traditional (and best, IMO) way, though.
>
> In 7.4 we have:
>
> Add DOMAIN CHECK constraints (Rod)
> Add ALTER DOMAIN .. SET / DROP NOT NULL, SET / DROP DEFAULT, ADD / DROP
> CONSTRAINT (Rod)

"Rod"??

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron(dot)l(dot)johnson(at)cox(dot)net
Jefferson, LA USA

Regarding war zones: "There's nothing sacrosanct about a hotel
with a bunch of journalists in it."
Marine Lt. Gen. Bernard E. Trainor (Retired)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message darren 2003-09-04 00:24:54 Re: TCL trigger doesn't work after deleting a column
Previous Message Josué Maldonado 2003-09-03 23:38:28 Re: TCL trigger doesn't work after deleting a column