Re: Domains and Joins

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: chester c young <chestercyoung(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Domains and Joins
Date: 2003-06-08 12:23:39
Message-ID: 1055075018.23997.43.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 2003-06-05 at 17:38, chester c young wrote:
> -- standard setup:
> create table t1( c1 int primary key, data text );
> create domain dom_c1 int references t1 on delete cascade;

This won't work. Domains support NOT NULL, and CHECK constraints.

Foreign keys are not allowed on domains at this time in PostgreSQL or in
the SQL99 spec.

> create table t2( c2 int primary key, c1 dom_c1, moredata text );

> -- will not work with "using"
> create view v1 as select t1.*, t2.moredata
> from t1 join t2 using( c1 );

It appears to be a complaint about mis-matched datatypes, which is
partially true. It's also a problem in 7.4. I'll see what I can do to
fix it.

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2003-06-08 15:08:25 Re: (long) What's the problem?
Previous Message Ian Barwick 2003-06-08 11:54:17 Re: Elegant SQL solution: