Re: Migrating a MySQL schema with an enum - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Migrating a MySQL schema with an enum
Date
Msg-id Pine.LNX.4.30.0203202350070.812-100000@peter.localdomain
Whole thread Raw
In response to Re: Migrating a MySQL schema with an enum  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List 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



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: delete -> copy in -> WAL problem..?
Next
From: Martín Marqués
Date:
Subject: Re: Migrating a MySQL schema with an enum