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 23:55:19
Message-ID: 950007.1715212519@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:
> Let me simplify this a bit. But the parameter "relocatable" has nothing to
> do with this, "schema" does.

> ===========================
>> cat testext.control
> comment = 'testing extension'
> default_version = '1.0'
> relocatable = false
> trusted = false

>> cat testext--1.1.control
> schema=pg_control

So the actual situation with pg_cron is that they've *never* been
relocatable, but now they want to bind a particular schema where
before they let the user choose?

I absolutely won't accept a suggestion that we should allow ALTER
SET SCHEMA if the extension is saying it's not relocatable.
Potentially breaking other non-relocatable extensions is not
an okay tradeoff for coping with an extremely questionable
decision on pg_cron's part.

I'm also not really inclined to assume that even if we let
SET SCHEMA happen, it would successfully move such an extension.
I think a reasonable penalty on pg_cron for this is that they
should have to supply an extension upgrade script that does
per-object ALTER XXX SET SCHEMA to get everything (or at least
as much as they want) into the newly selected schema.

I do see a missing bit, which is that if the new control
file says schema = whatever, we should probably update
extnamespace to match --- which I guess was your point
as well. But I don't want to take responsibility for
making the member objects match that.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-05-09 00:50:20 Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore
Previous Message David G. Johnston 2024-05-08 23:32:43 Re: Upgrading an extension's extnamespace from user-specified to a defined schema breaks dump/restore