From: Jan Wieck <JanWieck@Yahoo.com>
To: josh@agliodbs.com
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Richard Huxton <dev@archonet.com>
Cc: Markus Bertheau <twanger@bluetwanger.de>
Cc: olly@lfix.co.uk, pgsql-sql@postgresql.org, Bruce Momjian <pgman@candle.pha.pa.us>
Subject: Re: multi column foreign key for implicitly unique columns
Date: Wed, 18 Aug 2004 18:33:01 -0400
Message-ID: <4123D91D.8060601@Yahoo.com> (raw)
In-Reply-To: <200408181155.34472.josh@agliodbs.com>
References: <1092734724.2627.4.camel@dicaprio.akademie1.de>
<1803.1092847586@sss.pgh.pa.us>
<41239990.1000007@Yahoo.com>
<200408181155.34472.josh@agliodbs.com>
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 #
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: JanWieck@Yahoo.com, josh@agliodbs.com, tgl@sss.pgh.pa.us, dev@archonet.com, twanger@bluetwanger.de, pgman@candle.pha.pa.us
Subject: Re: multi column foreign key for implicitly unique columns
In-Reply-To: <4123D91D.8060601@Yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox