creation of foreign key without checking prior data? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject creation of foreign key without checking prior data?
Date
Msg-id 20090917164008.GA32709@depesz.com
Whole thread Raw
Responses Re: creation of foreign key without checking prior data?
List pgsql-general
Hi,
would it be possible to add a way to create foreign key without checking
of prior data?

Before you will say it's a bad idea, because then you might get invalid
data - i know. You can geet invalid data in column that is checked by
foriegn key even now - by temporarily disablnig triggers and/or writing
special (or bad) triggers.

So, since (as we know) foreign keys are not fault-proof, wouldn't it be
good to provide a way to create them without all this time-consuming
check? It would come handy for example when loading dumps (disabling
fkey for load is bad option, because you need first to create it, before
you can disable it, and to create it you need unique constraint on
referenced table, which required index - and i don't want index to be
created before data is loaded, because it's just too slow.

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

pgsql-general by date:

Previous
From: Adam Rich
Date:
Subject: Re: Multiple counts on criteria - Approach to a problem
Next
From: Bill Moran
Date:
Subject: Re: Multiple counts on criteria - Approach to a problem