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

From Robert Treat
Subject Re: pg_restore and create FK without verification check
Date
Msg-id 1069878767.24916.18.camel@camel
Whole thread Raw
In response to Re: pg_restore and create FK without verification check  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgsql-hackers
On Wed, 2003-11-26 at 12:43, Andreas Pflug wrote:
> 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.

ISTM I've done this before... from a pg_dump -Fc backup first do a
pg_dump -s restore (schema only) and then a pg_dump -a
--disable-triggers to load the data without check foreign keys. 

Theres certainly potential for trouble with this method I suppose but it
seems like it accomplish what the original poster requires...


Robert Treat

-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Limiting factors of pg_largeobject
Next
From: Neil Conway
Date:
Subject: Re: detecting poor query plans