Re: Proposed feature: Selective Foreign Key - Mailing list pgsql-hackers

From Niels Hoogeveen
Subject Re: Proposed feature: Selective Foreign Key
Date
Msg-id DUB129-W34221F5F82B943EEDDD9718B720@phx.gbl
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Portability issues in shm_mq
Next
From: Tomas Vondra
Date:
Subject: Re: jsonb and nested hstore