enumeration type?

Поиск
Список
Период
Сортировка
Искать

enumeration type?

От:
Tina Messmann <tina.messmann@xinux.de>
Дата:
Hello List,
is there in PostgreSQL something like an enumeration type or have i to 
use the CREATE TYPE command to build my own enumeration type ?

Regards
Tina

Re: enumeration type?

От:
Karel Zak <zakkr@zf.jcu.cz>
Дата:
On Tue, Dec 18, 2001 at 10:32:21AM +0100, Tina Messmann wrote:
> Hello List,
> is there in PostgreSQL something like an enumeration type or have i to 
> use the CREATE TYPE command to build my own enumeration type ?

 You needn't enumeration type, you can use more standard CHECK
 option in table definition. For example:

 CREATE TABLE tab (
    y char(1) CHECK(y='A' OR y='B' OR y='C')
 );

        Karel

-- 
 Karel Zak  
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
FAQ