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

From Richard Huxton
Subject Re: pg_dump restore time and Foreign Keys
Date
Msg-id 4847A9CC.2010406@archonet.com
Whole thread Raw
In response to pg_dump restore time and Foreign Keys  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> 
> If we had a way of pg_dump passing on the information that the test
> already passes, we would be able to skip the checks.
> 
> Proposal:
> 
> * Introduce a new mode for ALTER TABLE ADD FOREIGN KEY [WITHOUT CHECK];

> * Have pg_dump write the new syntax into its dumps, when both the source
> and target table are dumped in same I've been known to manually tweak dumps before now. I can see me 
forgetting this.

What about pg_dump writing out a row-count and MD5 of the rows in the 
COPY (just a textual calculation). Iff the restore checksum matches the 
dump checksum for both tables then the foreign-keys can be skipped.

If the restore checksum doesn't match the dump then it can issue a 
warning, but continue and run the full fkey check.

--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Overhauling GUCS
Next
From: Gregory Stark
Date:
Subject: Re: Core team statement on replication in PostgreSQL