Re: Extensions not dumped when --schema is used

From: Noah Misch <noah(at)leadboat(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Extensions not dumped when --schema is used
Date: 2021-04-08 02:42:11
Message-ID: 20210408024211.GA893043@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 04, 2021 at 03:08:02PM -0700, Noah Misch wrote:
> On Wed, Mar 31, 2021 at 09:37:44AM +0900, Michael Paquier wrote:
> > On Tue, Mar 30, 2021 at 12:02:45PM +0900, Michael Paquier wrote:
> > > Okay. So I have looked at that stuff in details, and after fixing
> > > all the issues reported upthread in the code, docs and tests I am
> > > finishing with the attached. The tests have been moved out of
> > > src/bin/pg_dump/ to src/test/modules/test_pg_dump/, and include both
> > > positive and negative tests (used the trick with plpgsql for the
> > > latter to avoid the dump of the extension test_pg_dump or any data
> > > related to it).
> >
> > I have double-checked this stuff this morning, and did not notice any
> > issues. So, applied.
>
> I noticed the patch's behavior for relations that are members of non-dumped
> extensions and are also registered using pg_extension_config_dump(). It
> depends on the schema:
>
> - If extschema='public', "pg_dump -e plpgsql" makes no mention of the
> relations.
> - If extschema='public', "pg_dump -e plpgsql --schema=public" includes
> commands to dump the relation data. This surprised me. (The
> --schema=public argument causes selectDumpableNamespace() to set
> nsinfo->dobj.dump=DUMP_COMPONENT_ALL instead of DUMP_COMPONENT_ACL.)
> - If extschema is not any sort of built-in schema, "pg_dump -e plpgsql"
> includes commands to dump the relation data. This surprised me.
>
> I'm attaching a test case patch that demonstrates this. Is this behavior
> intentional?

I think this is a bug in $SUBJECT.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-04-08 02:42:20 Re: New IndexAM API controlling index vacuum strategies
Previous Message Julien Rouhaud 2021-04-08 02:38:08 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?