Skip site navigation (1) Skip section navigation (2)

Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Date: 2003-09-30 13:03:19
Message-ID: 3F797F17.2090404@pse-consulting.de (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Bruce Momjian wrote:

>Fact is, folks are doing it anyway by modifying pg_class.  I know one
>guy who did it in a transaction so he was the only one to see the
>triggers disabled!  The PostgreSQL cookbook page has an example too. 
>People are always asking how to do this.  Why not just make it setable
>only by the super-user.
>
>FYI, TODO has:
>
>	* Allow triggers to be disabled [trigger]
>	* With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN
>	  KEY
>

For practical reasons, I'd prefer the "disable trigger" not to influence 
fk triggers, or at least to have such a default flavor. When restoring a 
database, you might consider the data as consistent and complete, so no 
triggers and ref checks are needed at all. But in the cases of some kind 
of application data import, you might like the data to have fk ref 
checked, but don't want to trigger all user triggers.
The implementation of fk checking by triggers should normally be hidden 
to the user.

Regards,
Andreas


In response to

pgsql-hackers by date

Next:From: Patrick WelcheDate: 2003-09-30 13:13:31
Subject: Re: ecpg doesn't compile (datetime.h/dtime_t)
Previous:From: Bruce MomjianDate: 2003-09-30 12:40:03
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)

pgsql-general by date

Next:From: ArguileDate: 2003-09-30 13:06:43
Subject: Re: Functional index performance question
Previous:From: btoberDate: 2003-09-30 12:57:47
Subject: Re: Where are user-defined types stored/viewed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group