Re: multi column foreign key for implicitly unique columns

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Richard Huxton <dev(at)archonet(dot)com>, Markus Bertheau <twanger(at)bluetwanger(dot)de>, olly(at)lfix(dot)co(dot)uk, pgsql-sql(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: multi column foreign key for implicitly unique columns
Date: 2004-08-18 18:55:34
Message-ID: 200408181155.34472.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

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.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2004-08-18 19:24:40 Re: multi column foreign key for implicitly unique columns
Previous Message Josh Berkus 2004-08-18 18:52:56 Re: SQL Challenge: Arbitrary Cross-tab