Re: Type modifiers for DOMAIN

Поиск
Список
Период
Сортировка
От Takahiro Itagaki
Тема Re: Type modifiers for DOMAIN
Дата
Msg-id 20100107094323.97A1.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Type modifiers for DOMAIN  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Because the domain is supposed to be opaque as to exactly what its
> underlying type is.  In particular, you're supposed to do this:
> 
>     CREATE DOMAIN varchar2 AS pg_catalog.varchar(10);
> 
> If you look in the SQL spec you will not find any suggestion that it
> should work the way you propose.

Hmmm, it means we need to create domains for each length of character types.
If we allowed domains with pass-through-modifiers, it could save codes
than CREATE (scalar) TYPE.
=# CREATE DOMAIN digit_varchar AS varchar ( <pass-through-modifiers> )     CHECK (VALUE ~ E'^\\d*$');=# CREATE TABLE
tbl(digit10 digit_varchar(10));
 

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center




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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: unresolved bugs
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: unresolved bugs