creation of foreign key without checking prior data?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: creation of foreign key without checking prior data?
Date: 2009-09-17 16:40:08
Message-ID: 20090917164008.GA32709@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2009-09-17 16:44:17 Re: Multiple counts on criteria - Approach to a problem
Previous Message Ben Chobot 2009-09-17 16:35:06 Re: Multiple counts on criteria - Approach to a problem