Re: Proposed feature: Selective Foreign Key

From: Niels Hoogeveen <pd_aficionado(at)hotmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposed feature: Selective Foreign Key
Date: 2014-03-16 02:05:27
Message-ID: DUB129-W34221F5F82B943EEDDD9718B720@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/28/2013 09:15 AM, Tom Dunstan wrote: > Feature Proposal: Selective foreign keys. > ------------------------------------------------- > Allow foreign keys to have where clauses.
I like this feature. One of the issues I have been trying to deal with is how to model countries and their subdivision. One table can suffice to register all countries, but the subdivisions of countries can have different columns and constraints. Having a where clause in a foreign key constraint would make it possible to have a table for state_us which can only contain rows referring the to USA and a table for departement_fr which can only contain rows referring to France.
I hope this feature somehow gets it into a release some day.
Niels

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2014-03-16 02:07:26 Re: jsonb and nested hstore
Previous Message Robert Haas 2014-03-16 01:24:40 Re: Portability issues in shm_mq