Re: ENUM like data type
| От | PFC |
|---|---|
| Тема | Re: ENUM like data type |
| Дата | |
| Msg-id | op.ss3aruu5th1vuj@localhost обсуждение исходный текст |
| Ответ на | Re: ENUM like data type (Mike Rylander <mrylander@gmail.com>) |
| Ответы |
Re: ENUM like data type
|
| Список | pgsql-sql |
>> Here is where I get uncertain as to if this is possible. My idea is to >> create a pseudo type that triggers the creation of it's lookup tables >> the same way the SERIAL type triggers creation of a sequence and returns >> an int with the right default value. Personnally I use one table which has columns (domain, name) and which stores all enum values for all different enums.I have then CHECK( is_in_domain( column, 'domain_name' )) which is a simple function which checks existence of the value in this domain (SELECT 1 FROM domains WHERE domain=$2 AND name=$1 LIMIT 1) for instance.You can also use integers.
В списке pgsql-sql по дате отправления: