Re: Migrating a MySQL schema with an enum

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Migrating a MySQL schema with an enum
Дата
Msg-id Pine.LNX.4.30.0203202350070.812-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: Migrating a MySQL schema with an enum  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: delete -> copy in -> WAL problem..?
Следующее
От: Martín Marqués
Дата:
Сообщение: Re: Migrating a MySQL schema with an enum