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