pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tweak behavior of pg_dump --extension with configuration tables
Date: Thu, 15 Apr 2021 01:10:07 +0000
Message-ID: <E1lWqWF-0004Dp-Ut@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/344487e2db03f3cec13685a839dbc8a0e2a36750

Modified Files
--------------
doc/src/sgml/ref/pg_dump.sgml               |  6 +++++
src/bin/pg_dump/pg_dump.c                   | 12 +++++++++-
src/test/modules/test_pg_dump/t/001_base.pl | 34 +++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 1 deletion(-)



Message-ID: <E1lWqWF-0004Dp-Ut@gemulon.postgresql.org>
Permalink:  ../E1lWqWF-0004Dp-Ut@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lWqWF-0004Dp-Ut@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Tweak behavior of pg_dump --extension with configuration tables
  In-Reply-To: <E1lWqWF-0004Dp-Ut@gemulon.postgresql.org>
  References: <E1lWqWF-0004Dp-Ut@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox