Re: multi column foreign key for implicitly unique columns - Mailing list pgsql-sql

From Josh Berkus
Subject Re: multi column foreign key for implicitly unique columns
Date
Msg-id 200408181236.14736.josh@agliodbs.com
Whole thread Raw
In response to Re: multi column foreign key for implicitly unique columns  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
Bruno,

> If users is supposed to reference status you can do this by adding a
> relation column to users, using a constraint to force relation to always be
> 'users' and then having (status, relation) being a foreign key.

But that requires the addition of an extra, indexed Text column to the table.  
And the "status" reference table is not the only place I need this construct; 
I have other relationships to reference tables which are similar.   It would 
amount to adding probably a total of 25-40 columns to various tables in my 
database overall; maybe 100MB of completely redundant data.  :-(

I'll wait for ASSERTIONS, I think.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: multi column foreign key for implicitly unique columns
Next
From: Theo Galanakis
Date:
Subject: Re: