REFERENCES constraint - Mailing list pgsql-sql

From Cedar Cox
Subject REFERENCES constraint
Date
Msg-id Pine.LNX.4.21.0108081850160.12272-100000@nanu.visionforisrael.com
Whole thread Raw
Responses Re: REFERENCES constraint
Re: REFERENCES constraint
Re: REFERENCES constraint
Re: REFERENCES constraint
List pgsql-sql
Two questions (maybe they are silly..)

1. Can a column reference more than one table?  (This assumes you use a
single sequence to generate the IDs for both "tbla" and "tblb".  I guess
you would also have the problem of enforcing a unique index.  Say what?!  
A unique index across multiple tables.. absurd :)  eg..
 CREATE TABLE blah (   id int4,   f_id int4 REFERENCES tbla (id) REFERENCES tblb (id) )

2. Can a column reference another column in the same table?  eg..
 CREATE TABLE bloo (   id int4,   p_id int4 REFERENCES bloo (id) -- or --p_id int4 REFERENCES (id) )

I'm guessing the answer is no, in which case I have to fall back to
writing custom PL/ functions and triggers.  Just thought I'd ask anyway.  
It would be nice if it were this easy though...

-Cedar
p.s. please CC my on this thread.. I'm on vacation (on this list) :0



pgsql-sql by date:

Previous
From: "Chris Ruprecht"
Date:
Subject: Re: Functions returning more than one value
Next
From: Jeff Eckermann
Date:
Subject: RE: RE: Referencing named attribute in where clause doesn't work with7.1.2?