Re: Type modifiers for DOMAIN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Type modifiers for DOMAIN
Date
Msg-id 11489.1262796876@sss.pgh.pa.us
Whole thread Raw
In response to Type modifiers for DOMAIN  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Type modifiers for DOMAIN  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Bug with PATHs having non-ASCII characters  (Chuck McDevitt <cmcdevitt@greenplum.com>)
List pgsql-hackers
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes:
> Domains were created successfully, but I cannot use type modifiers for them.
>     =# CREATE TABLE tbl (v varchar2(10));
>     ERROR:  type modifier is not allowed for type "varchar2"

> What reason do we have not to inherit typmodin/typmodout from the base type?

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 'replication' keyword on .pgpass (Streaming Replication)
Next
From: Tom Lane
Date:
Subject: Re: Streaming replication and postmaster signaling