Re: Domain Support -- another round - Mailing list pgsql-patches

From Fernando Nasser
Subject Re: Domain Support -- another round
Date
Msg-id 3C99FD03.96D1467B@redhat.com
Whole thread Raw
In response to Re: Domain Support -- another round  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
Rod Taylor wrote:
>
> > 2. Arrays.  I don't much care for the fact that arrays of
> domain-type
> > values aren't supported.  The handling of domains that are
> themselves
> > arrays seems a tad odd as well: the array-ish nature of the domain
> is
> > exposed, which doesn't make a lot of sense to me.  Perhaps we'd be
> > better off to forbid array domains.
>
> The reason I didn't make array types for domains is that I have
> absolutly no idea how to manage the below case once point 4 is
> implemented.
>
> create domain dom as int4 check (VALUE > 5);
> create table tab (col1 dom[2][3]);
>

SQL'99 explicitly forbids it.  Please refer to my posting to HACKERS
for the SQL document reference.



> > 3. Domains on domains.  Why shouldn't I be able to make a domain
> that's
> > a further restriction of another domain?
>
> Not entirely sure, except the book I had (SQL99 Complete, Really)
> specifically forbids it.
>

Yes, but this is their interpretation of the standard. There is an
error in that page anyway, as the standard explicitly forbids
arrays and UDTs and they list REF and ARRAY as valid data types.
(they also get confused with SESSION_USER and CURENT_USER on page
281, so it does not surprise me).

I couldn't find anything in the standard explicitly forbidden it.
But I don't think this is a very useful feature anyway.  As one is
creating another domain, he /she can as well specify constraints
that represent a further reduction of the valid values range.



--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

pgsql-patches by date:

Previous
From: "Rod Taylor"
Date:
Subject: Re: Domain Support -- another round
Next
From: Ferdinand Smit
Date:
Subject: Re: pg_dump and transactions