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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>,Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>,Peter Childs <Blue(dot)Dragon(at)blueyonder(dot)co(dot)uk>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Date: 2003-09-30 04:29:40
Message-ID: 16054.1064896180@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Jan Wieck wrote:
>> Tom Lane wrote:
>>> if we were to go that route would be a boolean GUC variable that simply
>>> prevents ALTER TABLE ADD FOREIGN KEY from doing the validity checks.
>> 
>> Okay too. And this would be simple and safe enough to add it at the time 
>> being.

> If we go that direction, why don't we just make a GUC variable to
> disable constraint checking.

You mean in general, even for plain old insert/update/delete changes?
Yipes.  What happened to ACID compliance?

What I actually expected to ensue was a discussion about how we could
narrow down the effects of a disable-foreign-key-verification switch to
reduce the odds of shooting oneself in the foot.  (For example, maybe
disallow it from being set in postgresql.conf.)  I wasn't expecting
proposals to enlarge the gauge of the foot-gun ...

> Also, how does someone turn it on at restore time if they are piping
> into psql?

Something like
export PGOPTIONS="-c disable-fk-verification=true"
then run psql or pg_restore.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Stephan SzaboDate: 2003-09-30 04:31:31
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Previous:From: Christopher Kings-LynneDate: 2003-09-30 04:27:11
Subject: signal to send to postgres when log rolling

pgsql-general by date

Next:From: Stephan SzaboDate: 2003-09-30 04:31:31
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Previous:From: Bruce MomjianDate: 2003-09-30 04:18:59
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)

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