Re: Domain Support -- another round

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Domain Support -- another round
Date: 2002-03-21 15:32:19
Message-ID: 3C99FD03.96D1467B@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-03-21 15:42:18 Re: [PATCHES] Domain Support -- another round
Previous Message Peter Eisentraut 2002-03-21 15:26:49 Re: Linux/mips compile should not use -mips2

Browse pgsql-patches by date

  From Date Subject
Next Message Rod Taylor 2002-03-21 15:42:18 Re: [PATCHES] Domain Support -- another round
Previous Message Rod Taylor 2002-03-21 15:03:20 Re: Domain Support -- another round