Make pg_dump --data-only try to order the table dumps so that foreign keys'

Tom Lane <tgl@sss.pgh.pa.us>

Commit: bc01b45ab9fc4774e0adbe971bd0fff5a17f5705
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-09-08T15:26:23Z
Releases: 8.4.0
Make pg_dump --data-only try to order the table dumps so that foreign keys'
referenced tables are dumped before the referencing tables.  This avoids
failures when the data is loaded with the FK constraints already active.
If no such ordering is possible because of circular or self-referential
constraints, print a NOTICE to warn the user about it.

Files

PathChange+/−
src/bin/pg_dump/pg_dump.c modified +65 −5
src/bin/pg_dump/pg_dump.h modified +3 −1
src/bin/pg_dump/pg_dump_sort.c modified +30 −2