pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Markus Bertheau <twanger@bluetwanger.de>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: multi column foreign key for implicitly unique columns
Date: Tue, 17 Aug 2004 11:38:14 -0400
Message-ID: <4876.1092757094@sss.pgh.pa.us> (raw)
In-Reply-To: <20040817081306.J61699@megazone.bigpanda.com>
References: <1092734724.2627.4.camel@dicaprio.akademie1.de>
	<4121D55D.1040105@archonet.com>
	<20040817072443.S60684@megazone.bigpanda.com>
	<4307.1092753995@sss.pgh.pa.us>
	<1092754658.2627.32.camel@dicaprio.akademie1.de>
	<20040817080425.U61699@megazone.bigpanda.com>
	<1092755530.2627.36.camel@dicaprio.akademie1.de>
	<20040817081306.J61699@megazone.bigpanda.com>

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 whose referenced 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 effective execution of the
            <alter table statement> specified in the General Rules of this
            Subclause.

			regards, tom lane



view thread (38+ messages)  latest in thread

Message-ID: <4876.1092757094@sss.pgh.pa.us>
Permalink:  ../4876.1092757094@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4876.1092757094@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sszabo@megazone.bigpanda.com, twanger@bluetwanger.de, dev@archonet.com
  Subject: Re: multi column foreign key for implicitly unique columns
  In-Reply-To: <4876.1092757094@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox