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 092875E46C5 for ; Wed, 18 Aug 2004 19:33:27 -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 80377-08 for ; Wed, 18 Aug 2004 22:33:30 +0000 (GMT) Received: from smtp015.mail.yahoo.com (smtp015.mail.yahoo.com [216.136.173.59]) by svr1.postgresql.org (Postfix) with SMTP id AE4D15E3F15 for ; Wed, 18 Aug 2004 19:33:19 -0300 (ADT) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp015.mail.yahoo.com with SMTP; 18 Aug 2004 22:33:31 -0000 Received: from [172.21.8.18] ([192.168.192.101]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id i7IMX8T7070731; Wed, 18 Aug 2004 18:33:13 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <4123D91D.8060601@Yahoo.com> Date: Wed, 18 Aug 2004 18:33:01 -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: josh@agliodbs.com Cc: Tom Lane , Richard Huxton , Markus Bertheau , 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> <1803.1092847586@sss.pgh.pa.us> <41239990.1000007@Yahoo.com> <200408181155.34472.josh@agliodbs.com> In-Reply-To: <200408181155.34472.josh@agliodbs.com> Content-Type: text/plain; charset=us-ascii; format=flowed 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/216 X-Sequence-Number: 18713 On 8/18/2004 2:55 PM, Josh Berkus wrote: > Jan, >> >> If a.x is unique, then (b.x, b.y) references (a.x, a.y) is only ensuring >> that the redundant copy of y in b.y stays in sync with a.y. > > So? What's denormalized about that? His other choice is to use a trigger. Because the value in b.y is redundant. b.x->a.x->a.y is exactly the same value and he even wants to ensure this with the constraint. Jan > > What he's trying to do is ensure that the class selected for the FK > class_name, field_name relates to the same class_name in objects. > -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #