Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-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


pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group