Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srhYT-003szu-NX for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Sep 2024 17:36:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1srhYR-00ApjV-Kl for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Sep 2024 17:36:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srhYR-00ApjM-C2 for pgsql-bugs@lists.postgresql.org; Fri, 20 Sep 2024 17:36:28 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srhYO-000DoG-Nr for pgsql-bugs@lists.postgresql.org; Fri, 20 Sep 2024 17:36:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 48KHaNUB2464497; Fri, 20 Sep 2024 13:36:23 -0400 From: Tom Lane To: Evgeni Golov cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18625: user-created extensions change ownership to "postgres" after upgrade In-reply-to: References: <18625-77d1e2609972c616@postgresql.org> <2422972.1726841792@sss.pgh.pa.us> <2443799.1726849080@sss.pgh.pa.us> Comments: In-reply-to Evgeni Golov message dated "Fri, 20 Sep 2024 19:05:06 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2464495.1726853783.1@sss.pgh.pa.us> Date: Fri, 20 Sep 2024 13:36:23 -0400 Message-ID: <2464496.1726853783@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Evgeni Golov 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