From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: developer@moregatebiotech.com <developer@moregatebiotech.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema
Date: Wed, 22 Jun 2022 10:01:52 -0400
Message-ID: <3344794.1655906512@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZPcWJ8FTQx_uqCoBuQGxyn5ML37iTe5igid1p++UqU7Q@mail.gmail.com>
References: <17526-2e7a7cf9eb165a82@postgresql.org>
<CAKFQuwZPcWJ8FTQx_uqCoBuQGxyn5ML37iTe5igid1p++UqU7Q@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Not a bug. Extension members are not dumped because the system expects
> that a subsequent create extension command will create them. That is what
> it means to be a member of the extension. Most users are not going to
> execute the “alter extension add” command on there database as it doesn’t
> really provide end-user useful functionality.
Yeah. Correct use of this option would be to put the CREATE SCHEMA
command in an extension upgrade script. (Notionally, you could also
write "alter extension ... add schema ..." in that script, but the
extension script execution mechanism takes care of that for you.)
> Extension assigned to a schema is not the correct model here. “Given
> control of the schema” or “Schema becomes an implementation detail of the
> extension” are.
If you want to put the extension's objects into a user-selected schema,
you just create the schema and do "create extension ... with schema ...".
It is not correct to then do "alter extension ... add schema", because
in this approach the schema does not "belong to" the extension.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, developer@moregatebiotech.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema
In-Reply-To: <3344794.1655906512@sss.pgh.pa.us>
* 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