Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema
Date
Msg-id 3344794.1655906512@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
"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



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17526: PG_DUMP is not outputting "CREATE SCHEMA" statements when an extension is assigned to a schema
Next
From: Jacob Champion
Date:
Subject: Re: BUG #17522: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL test fails on OpenBSD 7.1