Re: pg_dump restore time and Foreign Keys - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: pg_dump restore time and Foreign Keys
Date
Msg-id 48479381.6020006@enterprisedb.com
Whole thread Raw
In response to pg_dump restore time and Foreign Keys  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: pg_dump restore time and Foreign Keys  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> I'm guessing that the WITHOUT CHECK option would not be acceptable as an
> unprotected trap for our lazy and wicked users. :-)

Yes, that sounds scary.

Instead, I'd suggest finding ways to speed up the ALTER TABLE ADD 
FOREIGN KEY. Or speeding up COPY into a table with foreign keys already 
defined. For example, you might want to build an in-memory hash table of 
the keys in the target table, instead of issuing a query on each INSERT, 
if the target table isn't huge.

Nothing beats the speed of simply not checking the constraint, of 
course, but I'd hate to lose the protection it gives.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: Overhauling GUCS
Next
From: Simon Riggs
Date:
Subject: Re: pg_dump restore time and Foreign Keys