pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Subject: Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore
Date: Wed, 08 May 2024 18:29:59 -0400
Message-ID: <935496.1715207399@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYbqurFWg0W8mqBsHLsCyxZAZqBdV0q-beEFTbeBNhO2A@mail.gmail.com>
References: <CAKFQuwa1cb9y6OW9rSmXFGH69J3ZEQOm3+Od4Ang4qi74YHcTw@mail.gmail.com>
	<CAKFQuwYbqurFWg0W8mqBsHLsCyxZAZqBdV0q-beEFTbeBNhO2A@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Apr 15, 2024 at 8:15 PM David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>> tl/dr - alter extension ... set schema ...  needs to update
>> pg_extension.extnamespace if the named schema matches the current value in
>> the control file.  Otherwise, extension authors can and have introduced a
>> dump/restore failure mode that the DBA can only fix via direct catalog
>> manipulation.

> Tom's recent bug regarding alter extension reminded me that no has
> expressed an opinion on this one.

A quick test says that ALTER EXTENSION SET SCHEMA *does* update
pg_extension.extnamespace to the new schema.

Re-reading your original message, I'm of the opinion that pg_cron's
control files are probably broken.  If they are changing from
relocatable to not, then they need to specify that property in
a version-specific control file not the main one.  Maybe there's
something else that needs to happen in our code, but updating
extnamespace doesn't seem to be it.  Also, I do see code that
purports to cope with a version-related update of the relocatable
flag --- whether we test that, I'm not sure, but there's not
something obviously missing.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <935496.1715207399@sss.pgh.pa.us>
Permalink:  ../935496.1715207399@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/935496.1715207399@sss.pgh.pa.us

 · 

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 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, pgsql-bugs@lists.postgresql.org
  Subject: Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore
  In-Reply-To: <935496.1715207399@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