Re: Migrating a MySQL schema with an enum

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Keith Gray <keith(at)heart(dot)com(dot)au>, SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Migrating a MySQL schema with an enum
Date: 2002-03-21 04:50:48
Message-ID: Pine.LNX.4.30.0203202350070.812-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)gmx(dot)net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Martín Marqués 2002-03-21 11:31:44 Re: Migrating a MySQL schema with an enum
Previous Message Tom Lane 2002-03-21 04:42:25 Re: delete -> copy in -> WAL problem..?