Re: multi column foreign key for implicitly unique columns

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: multi column foreign key for implicitly unique columns
Date: 2004-08-17 14:57:38
Message-ID: 1092754658.2627.32.camel@dicaprio.akademie1.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

В Втр, 17.08.2004, в 16:46, Tom Lane пишет:

> I think one reason for this is that otherwise it's not clear which
> unique constraint the FK constraint depends on. Consider
>
> create table a (f1 int unique, f2 int unique);
>
> create table b (f1 int, f2 int,
> foreign key (f1,f2) references a(f1,f2));
>
> How would you decide which constraint to make the FK depend on?

Either way, the semantics are the same, right?

--
Markus Bertheau <twanger(at)bluetwanger(dot)de>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-08-17 15:06:05 Re: multi column foreign key for implicitly unique columns
Previous Message Markus Bertheau 2004-08-17 14:51:21 Re: SELECT MAX(c) FROM (SELECT ... FOR UPDATE) AS foo