> Keith Gray writes:
> > Migrating a MySQL schema with an enum to PostgreSQL,
> > is there an equivalent type or do I have to declare
> > another table for "enum" values.
> 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.
I use a varbit field and do the translations from an array of strings to a
bitset and vice versa in the app layer.
In response to
pgsql-sql by date
|Next:||From: Tom Lane||Date: 2002-03-21 04:42:25|
|Subject: Re: delete -> copy in -> WAL problem..? |
|Previous:||From: Peter Eisentraut||Date: 2002-03-21 00:02:21|
|Subject: Re: Migrating a MySQL schema with an enum|