On 3 Dec 2013, at 01:34, Andrew Dunstan <and...@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 using it 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, but then sometimes you don’t get to 
just rewrite the schema as there are legacy systems etc etc.

Cheers

Tom

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to