Re: replacing mysql enum

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: replacing mysql enum
Дата
Msg-id 200412111016.25046.josh@agliodbs.com
обсуждение исходный текст
Ответ на replacing mysql enum  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
Список pgsql-sql
Kenneth,

> i translated this as:
>
> field varchar(2) check (field in (null,'a','b','c')),

While this isn't the question you asked, might I encourage you to use DOMAINs 
instead?   I.e.:

CREATE DOMAIN abc_col AS TEXTCHECK VALUE IN ( 'a', 'b', 'c' );

Then you declare the table as:

table (field abc_col,
);

I find that DOMAINs give vastly enhanced managability compared to table 
constraints.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: replacing mysql enum
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: filtering