Re: 'enum' equivalent? - Mailing list pgsql-general

From Zachary Beane
Subject Re: 'enum' equivalent?
Date
Msg-id 20010121230104.T11005@xach.com
Whole thread Raw
In response to 'enum' equivalent?  (Steve Leibel <stevel@bluetuna.com>)
List pgsql-general
On Sun, Jan 21, 2001 at 10:33:02PM -0500, Steve Leibel wrote:
> Hello,
>
> I'm converting a mysql database to postgres.  Is there an equivalent
> for the enum data type?

If you want to make a column limited to few certain values, you can
define it something like:

    mycolumn varchar(3) check (mycolumn in ('foo', 'bar', 'baz'))

That would be somewhat similar in effec to mysql's

    mycolumn enum('foo', 'bar', 'baz')

Zach
--
xach@xach.com     Zachary Beane     http://www.xach.com/

pgsql-general by date:

Previous
From: Steve Leibel
Date:
Subject: 'enum' equivalent?
Next
From: Guillaume Lémery
Date:
Subject: Re: Troubles with performances