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 6778C5E46E2 for ; Wed, 18 Aug 2004 13:46:12 -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 56065-08 for ; Wed, 18 Aug 2004 16:46:17 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 577E45E46DE for ; Wed, 18 Aug 2004 13:46:08 -0300 (ADT) Received: from [134.22.71.19] (dyn-71-19.tor.dsl.tht.net [134.22.71.19]) by tht.net (Postfix) with ESMTP id E45F676AF3; Wed, 18 Aug 2004 12:46:17 -0400 (EDT) Subject: Re: multi column foreign key for implicitly unique columns From: Rod Taylor To: Jan Wieck Cc: Tom Lane , Richard Huxton , Markus Bertheau , Josh Berkus , olly@lfix.co.uk, pgsql-sql@postgresql.org, Bruce Momjian In-Reply-To: <4123837C.30408@Yahoo.com> References: <1092734724.2627.4.camel@dicaprio.akademie1.de> <1092735576.28365.48.camel@linda> <1092736197.2627.12.camel@dicaprio.akademie1.de> <200408171945.15663.josh@agliodbs.com> <41235A90.1080300@Yahoo.com> <1092836961.2630.3.camel@dicaprio.akademie1.de> <41236277.5060903@Yahoo.com> <22808.1092842209@sss.pgh.pa.us> <41237DA2.9090405@archonet.com> <1535.1092845917@sss.pgh.pa.us> <4123837C.30408@Yahoo.com> Content-Type: text/plain Message-Id: <1092847573.32799.148.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 18 Aug 2004 12:46:14 -0400 Content-Transfer-Encoding: 7bit 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/203 X-Sequence-Number: 18700 On Wed, 2004-08-18 at 12:27, Jan Wieck wrote: > On 8/18/2004 12:18 PM, Tom Lane wrote: > > > Richard Huxton writes: > >> * Allow multiple unique constraints to share an index where one is a > >> superset of the others' columns. > > > >> That way you can mark it unique without having the overhead of multiple > >> indexes. > > > > That just moves the uncertain-dependency problem over one spot, ie, it's > > the fabricated unique constraint that you can't pin down the > > requirements for. > > If we allow for a unique index, that Silly question, but why does UNIQUE require an index at all? Yes, current implementation does, and agreed that checks will be mighty slow without an index (so are CASCADES to a non-indexed column)...