Re: BUG #18625: user-created extensions change ownership to "postgres" after upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Evgeni Golov <evgeni(at)golov(dot)de>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18625: user-created extensions change ownership to "postgres" after upgrade
Date: 2024-09-20 17:36:23
Message-ID: 2464496.1726853783@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Evgeni Golov <evgeni(at)golov(dot)de> writes:
> On Fri, Sep 20, 2024 at 12:18:00PM GMT, Tom Lane wrote:
>> You could do that as superuser, but it's not really enough because
>> there are pg_shdepend entries that ought to be added/updated.

> What happens if those (pg_shdepend.refobjid, pg_extension.extowner)
> are/get out of sync?

Stuff like DROP OWNED BY will misbehave, because it won't detect that
that extension belongs to that role.

>> The bigger picture here is that it's not just the pg_extension object
>> whose ownership is at stake. There are going to be objects belonging
>> to the extension that probably --- but not certainly --- should have
>> the same owner as the extension.

> Is there a way to find/list those related objects?

Sure, \dx+ in psql, or look in pg_depend for 'e' dependencies.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-09-20 17:55:02 Re: BUG #18624: Memory Leak Issue with PostgreSQL Connection During COPY Command Execution.
Previous Message Evgeni Golov 2024-09-20 17:05:06 Re: BUG #18625: user-created extensions change ownership to "postgres" after upgrade