Re: 'enum' equivalent?

Поиск
Список
Период
Сортировка
От Zachary Beane
Тема Re: 'enum' equivalent?
Дата
Msg-id 20010121230104.T11005@xach.com
обсуждение исходный текст
Ответ на 'enum' equivalent?  (Steve Leibel <stevel@bluetuna.com>)
Список pgsql-general
On Sun, Jan 21, 2001 at 10:33:02PM -0500, Steve Leibel wrote:
> Hello,
>
> I'm converting a mysql database to postgres.  Is there an equivalent
> for the enum data type?

If you want to make a column limited to few certain values, you can
define it something like:

    mycolumn varchar(3) check (mycolumn in ('foo', 'bar', 'baz'))

That would be somewhat similar in effec to mysql's

    mycolumn enum('foo', 'bar', 'baz')

Zach
--
xach@xach.com     Zachary Beane     http://www.xach.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Leibel
Дата:
Сообщение: 'enum' equivalent?
Следующее
От: Guillaume Lémery
Дата:
Сообщение: Re: Troubles with performances