X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0FDD85E37CB for ; Tue, 17 Aug 2004 11:57:56 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10796-04 for ; Tue, 17 Aug 2004 14:57:55 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id D68E65E3639 for ; Tue, 17 Aug 2004 11:57:52 -0300 (ADT) Received: from [62.165.4.166] (dicaprio.akademie1.de [62.165.4.166]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id i7HEvhg10547; Tue, 17 Aug 2004 16:57:44 +0200 Subject: Re: multi column foreign key for implicitly unique columns From: Markus Bertheau To: Tom Lane Cc: Stephan Szabo , Richard Huxton , pgsql-sql@postgresql.org In-Reply-To: <4307.1092753995@sss.pgh.pa.us> References: <1092734724.2627.4.camel@dicaprio.akademie1.de> <4121D55D.1040105@archonet.com> <20040817072443.S60684@megazone.bigpanda.com> <4307.1092753995@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Message-Id: <1092754658.2627.32.camel@dicaprio.akademie1.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 17 Aug 2004 16:57:38 +0200 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/170 X-Sequence-Number: 18667 =D0=92 =D0=92=D1=82=D1=80, 17.08.2004, =D0=B2 16:46, Tom Lane =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > I think one reason for this is that otherwise it's not clear which > unique constraint the FK constraint depends on. Consider >=20 > create table a (f1 int unique, f2 int unique); >=20 > create table b (f1 int, f2 int, > foreign key (f1,f2) references a(f1,f2)); >=20 > How would you decide which constraint to make the FK depend on? Either way, the semantics are the same, right? --=20 Markus Bertheau