Re: UNIQUE not unique with inheritance (workaround?) - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: UNIQUE not unique with inheritance (workaround?)
Date
Msg-id 1044742320.25462.58.camel@linda.lfix.co.uk
Whole thread Raw
In response to UNIQUE not unique with inheritance (workaround?)  (Samuel Sieb <samuel@sieb.net>)
Responses Re: UNIQUE not unique with inheritance (workaround?)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Sat, 2003-02-08 at 19:34, Samuel Sieb wrote:
> Is there any workaround for this problem?  I'm getting involved in a 
> project where inheritance is an incredibly useful feature, but the 
> non-unique issue could be a serious stumbling block.  Is there any way 
> to work around it with a trigger or something?

Give each table in the hierarchy a foreign key reference to another
table which holds a unique list of the primary keys and a column that
says which table they are in.  Use triggers to update this other table
and to prevent duplications in the hierarchy.

.
-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "But the LORD is in his holy temple; let all the earth      keep silence
beforehim."           Habakkuk 2:20 
 



pgsql-hackers by date:

Previous
From: Samuel Sieb
Date:
Subject: UNIQUE not unique with inheritance (workaround?)
Next
From: Olivier PRENANT
Date:
Subject: problems with configure