Re: pg_restore and create FK without verification check - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: pg_restore and create FK without verification check
Date
Msg-id 3FC4E637.3020509@pse-consulting.de
Whole thread Raw
In response to Re: pg_restore and create FK without verification check  (Greg Stark <gsstark@mit.edu>)
Responses Re: pg_restore and create FK without verification check  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Greg Stark wrote:

>If I could disable and reenable the constraint the danger that I would get the
>definition wrong would be eliminated. And if I had already done the work to
>ensure there were no broken relationships I would optionally be able to skip
>the redundant automatic check. I could even have done the verification myself
>while the data wasn't live for example.
>  
>

Since FKs are implemented as trigger, you could disable all triggers on 
the table right now, no? Could be a bit more comfortable, I agree, and 
hope for an upcoming DISABLE TRIGGER command.

While talking about this: I could add ENABLE/DISABLE TRIGGER 
functionality to pgadmin3. Unfortunately, on pg_trigger.tgenabled 
there's still the comment "not presently checked everywhere it should 
be, so disabling a trigger by setting this to false does not work 
reliably". I wonder if this is still true for 7.4. I can't imagine that 
this should be so hard to fix.

Regards,
Andreas




pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Optimizer cost calculation
Next
From: Tom Lane
Date:
Subject: Re: pg_restore and create FK without verification check