Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL Bug List <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore
Date: 2024-05-08 22:29:59
Message-ID: 935496.1715207399@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Mon, Apr 15, 2024 at 8:15 PM David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-05-08 23:12:47 Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore
Previous Message David G. Johnston 2024-05-08 22:01:37 Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore