Re: enumerated type..

Поиск
Список
Период
Сортировка
От Franco Bruno Borghesi
Тема Re: enumerated type..
Дата
Msg-id 1090245225.976.12.camel@taz.oficina
обсуждение исходный текст
Ответ на enumerated type..  ("raptor@tvskat.net" <raptor@tvskat.net>)
Список pgsql-general
CREATE DOMAIN is the answer:

CREATE DOMAIN mytype AS INT2 CHECK(VALUE>=1 AND VALUE<=6);

On Mon, 2004-07-19 at 10:43, raptor@tvskat.net wrote:
hi,

Is it possible in Postgre to have enum type,  so that later table fileld get values from 1-6 (saving space)

1 - statex
2 - stateY
3 - stateZ

something like that and then constrain on this enum type..

tia

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question on INSERT statement
Следующее
От: Damon Hart
Дата:
Сообщение: special table queries slow until dump/restore