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

From Tom Dunstan
Subject Re: Proposed feature: Selective Foreign Keys
Date
Msg-id 38553C89-B8B3-410E-90F1-F563DEC3D249@tomd.cc
Whole thread Raw
In response to Re: Proposed feature: Selective Foreign Keys  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 3 Dec 2013, at 01:34, Andrew Dunstan <andrew@dunslane.net> wrote:

> We wanted to apply FK constraints to a very large table, but grandfather in certain cases that didn't meet the
constraint.That could have been done very simply using this feature. 

Yeah, references to old data is the other obvious case for conditionally turning foreign keys off. I decided against
usingit as an example when trying to sell the feature as there are much easier workarounds than in the different-parent
case,and as a solution it really is a bit more ugly. But I suspect that it’s one that people have to deal with fairly
regularly.

It might encourage people to keep e.g. old ids in the same column when they should be putting them in a separate one,
butthen sometimes you don’t get to just rewrite the schema as there are legacy systems etc etc. 

Cheers

Tom


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Trust intermediate CA for client certificates
Next
From: Stephen Frost
Date:
Subject: Re: Trust intermediate CA for client certificates