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 4978A5E46C1 for ; Wed, 18 Aug 2004 11:07:00 -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 81536-05 for ; Wed, 18 Aug 2004 14:06:58 +0000 (GMT) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id D07915E40BB for ; Wed, 18 Aug 2004 11:06:55 -0300 (ADT) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp016.mail.yahoo.com with SMTP; 18 Aug 2004 14:07:00 -0000 Received: from [172.21.8.18] (ismtp.afilias.com [216.217.55.254]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id i7IE6sT7064308; Wed, 18 Aug 2004 10:06:54 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <41236277.5060903@Yahoo.com> Date: Wed, 18 Aug 2004 10:06:47 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Markus Bertheau Cc: Josh Berkus , olly@lfix.co.uk, pgsql-sql@postgresql.org, Bruce Momjian Subject: Re: multi column foreign key for implicitly unique columns 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> In-Reply-To: <1092836961.2630.3.camel@dicaprio.akademie1.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: * X-Archive-Number: 200408/191 X-Sequence-Number: 18688 On 8/18/2004 9:49 AM, Markus Bertheau wrote: > В Срд, 18.08.2004, в 15:33, Jan Wieck пишет: > >> Meaning that not enforcing the uniqueness of those columns isn't an >> option. > > The thing is that the columns _are_ unique, there's just no unique > constraint on them. They are unique because there's a unique constraint > on a subset of these columns. So no additional uniqueness enforcing > needed. > Yes, you are right, a superset of columns of a unique constraint is allways unique as well. I assume it is performance why you are denormalizing your data? However, Bruce, this should be on the TODO list: * Allow foreign key to reference a superset of the columns covered by a unique constraint on the referenced table. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #