Re: multi column foreign key for implicitly unique columns - Mailing list pgsql-sql

From Tom Lane
Subject Re: multi column foreign key for implicitly unique columns
Date
Msg-id 4876.1092757094@sss.pgh.pa.us
Whole thread Raw
In response to Re: multi column foreign key for implicitly unique columns  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> ... It sounds like it'd be a pain at best.

Also, that would directly violate the SQL spec's model of dependencies,
with possibly unpleasant consequences.  The current implementation does
exactly what SQL says to do.  I cite from SQL99 11.99 DROP CONSTRAINT:
        3) If TC is a unique constraint and RC is a referential constraint           whose referenced table is T and
whosereferenced columns are the           unique columns of TC, then RC is said to be dependent on TC.
 
        ...
        6) If RESTRICT is specified, then:
           a) No table constraint shall be dependent on TC.
           NOTE 195 - If CASCADE is specified, then any such dependent           object will be dropped by the
effectiveexecution of the           <alter table statement> specified in the General Rules of this
Subclause.
        regards, tom lane


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: multi column foreign key for implicitly unique columns
Next
From: Jean-Luc Lachance
Date:
Subject: Re: SELECT MAX(c) FROM (SELECT ... FOR UPDATE) AS foo