Re: Migrating a MySQL schema with an enum

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Keith Gray <keith@heart.com.au>, SQL <pgsql-sql@postgresql.org>
Date: 2002-03-21T04:50:48Z
Lists: pgsql-sql
Christopher Kings-Lynne writes:

> > Generally, you'd use a text field with a check constraint.  For example:
> >
> > CREATE TABLE car (
> >  ...
> >  color text check (color in ('blue', 'green', 'yellow')),
> >  ...
> > );
>
> Nope - cos you need 'blue,green' as a value, etc. as well.

That's not an enumeration type, that's a set.  For set's you create a
separate table.

-- 
Peter Eisentraut   peter_e@gmx.net