Re: 'enum' equivalent?
Zachary Beane <xach@xach.com>
From: Zachary Beane <xach@xach.com>
To: pgsql-general@postgresql.org
Date: 2001-01-22T04:01:04Z
Lists: pgsql-hackers, 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/