postgresql/src
Stephen Frost 43d81f16a3 Fix pg_dump handling of extension config tables
Since 9.1, we've provided extensions with a way to denote
"configuration" tables- tables created by an extension which the user
may modify.  By marking these as "configuration" tables, the extension
is asking for the data in these tables to be pg_dump'd (tables which
are not marked in this way are assumed to be entirely handled during
CREATE EXTENSION and are not included at all in a pg_dump).

Unfortunately, pg_dump neglected to consider foreign key relationships
between extension configuration tables and therefore could end up
trying to reload the data in an order which would cause FK violations.

This patch teaches pg_dump about these dependencies, so that the data
dumped out is done so in the best order possible.  Note that there's no
way to handle circular dependencies, but those have yet to be seen in
the wild.

The release notes for this should include a caution to users that
existing pg_dump-based backups may be invalid due to this issue.  The
data is all there, but restoring from it will require extracting the
data for the configuration tables and then loading them in the correct
order by hand.

Discussed initially back in bug #6738, more recently brought up by
Gilles Darold, who provided an initial patch which was further reworked
by Michael Paquier.  Further modifications and documentation updates
by me.

Back-patch to 9.1 where we added the concept of extension configuration
tables.
2015-03-02 14:12:33 -05:00
..
backend Fix planning of star-schema-style queries. 2015-02-28 12:43:04 -05:00
bin Fix pg_dump handling of extension config tables 2015-03-02 14:12:33 -05:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:39 -05:00
include Remove code to match IPv4 pg_hba.conf entries to IPv4-in-IPv6 addresses. 2015-02-17 12:49:18 -05:00
interfaces Fix potential deadlock with libpq non-blocking mode. 2015-02-23 13:32:42 +02:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:32 -05:00
pl Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables. 2015-02-25 23:48:54 -05:00
port Unlink static libraries before rebuilding them. 2015-03-01 13:06:39 -05:00
template Remove _FORTIFY_SOURCE 2012-10-10 21:42:38 -04:00
test Fix planning of star-schema-style queries. 2015-02-28 12:43:04 -05:00
timezone Update time zone data files to tzdata release 2015a. 2015-01-30 22:46:05 -05:00
tools Add pg_string_endswith as the start of a string helper library in src/common. 2015-01-03 20:54:13 +01:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes." 2013-10-07 22:32:04 -04:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:06:39 -05:00
nls-global.mk NLS: Use msgmerge --previous option 2012-12-13 23:12:12 -05:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00