]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Tweak behavior of pg_dump --extension with configuration tables
authorMichael Paquier <michael@paquier.xyz>
Thu, 15 Apr 2021 01:03:46 +0000 (10:03 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 15 Apr 2021 01:03:46 +0000 (10:03 +0900)
commit344487e2db03f3cec13685a839dbc8a0e2a36750
tree9bfb9d8bfcf7b4e51cf3deabc4cf26de3818626b
parente1623b7d86812ee6ab98a42f38b43a192c149988
Tweak behavior of pg_dump --extension with configuration tables

6568cef, that introduced the option, had an inconsistent behavior when
it comes to configuration tables set up by pg_extension_config_dump, as
the data of all configuration tables would included in a dump even for
extensions not listed by a set of --extension switches.

The contents dumped changed depending on the schema where an extension
was installed when an extension was not listed.  For example, an
extension installed under the public schema would have its configuration
data not dumped even when not listed with --extension, which was
inconsistent with the case of an extension installed on a non-public
schema, where the configuration would be dumped.

Per discussion with Noah, we have settled down to the simple rule of
dumping configuration data of an extension if it is listed in
--extension (default is unchanged and backward-compatible, to dump
everything on sight if there are no extensions directly listed).  This
avoids some weird cases where the dumps depended on a --schema for one.

More tests are added to cover the gap, where we cross-check more
behaviors depending on --schema when an extension is not listed.

Reported-by: Noah Misch
Reviewed-by: Noah Misch
Discussion: https://postgr.es/m/20210404220802.GA728316@rfd.leadboat.com
doc/src/sgml/ref/pg_dump.sgml
src/bin/pg_dump/pg_dump.c
src/test/modules/test_pg_dump/t/001_base.pl