pgsql: Fix pg_dump handling of extension config tables

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Fix pg_dump handling of extension config tables
Дата
Msg-id E1YSVm2-00038e-Pw@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c05fa34333f62de2641102600b5874a395cb289a

Modified Files
--------------
doc/src/sgml/extend.sgml  |   11 +++++++
src/bin/pg_dump/pg_dump.c |   78 ++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 88 insertions(+), 1 deletion(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: pgsql: Fix pg_dump handling of extension config tables
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Fix pg_dump handling of extension config tables