Re: Type modifiers for DOMAIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Type modifiers for DOMAIN
Date: 2010-01-06 16:54:36
Message-ID: 11489.1262796876@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-06 16:58:08 Re: Streaming replication and postmaster signaling
Previous Message Tom Lane 2010-01-06 16:51:30 Re: 'replication' keyword on .pgpass (Streaming Replication)