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 1s0Sjd-004PWp-64 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Apr 2024 21:03:56 +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 1s0Sja-00FvNC-8N for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Apr 2024 21:03:55 +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 1s0SjZ-00FvLl-V9 for pgsql-hackers@lists.postgresql.org; Fri, 26 Apr 2024 21:03:54 +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 1s0SjY-000EY9-DH for pgsql-hackers@lists.postgresql.org; Fri, 26 Apr 2024 21:03:54 +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 43QL3nTF032557; Fri, 26 Apr 2024 17:03:49 -0400 From: Tom Lane To: Daniel Gustafsson cc: PostgreSQL Hackers , Stephen Frost , Andres Freund Subject: Re: DROP OWNED BY fails to clean out pg_init_privs grants In-reply-to: References: <1745535.1712358659@sss.pgh.pa.us> <78CCD91B-99DC-4B0F-B65E-AD46E67CBC0B@yesql.se> <2857513.1713733688@sss.pgh.pa.us> Comments: In-reply-to Daniel Gustafsson message dated "Fri, 26 Apr 2024 15:41:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32555.1714165429.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Apr 2024 17:03:49 -0400 Message-ID: <32556.1714165429@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > On 21 Apr 2024, at 23:08, Tom Lane wrote: >> So the meson animals are not running the test that sets up the >> problematic data. > I took a look at this, reading code and the linked thread. My gut feeli= ng is > that Stephen is right in that the underlying bug is these privileges end= ing up > in pg_init_privs to begin with. That being said, I wasn't able to fix t= hat in > a way that doesn't seem like a terrible hack. Hmm, can't we put the duplicate logic inside recordExtensionInitPriv? Even if these calls need a different result from others, adding a flag parameter seems superior to having N copies of the logic. A bigger problem though is that I think you are addressing the original complaint from the older thread, which while it's a fine thing to fix seems orthogonal to the failure we're seeing in the buildfarm. The buildfarm's problem is not that we're recording incorrect pg_init_privs entries, it's that when we do create such entries we're failing to show their dependency on the grantee role in pg_shdepend. We've missed spotting that so far because it's so seldom that pg_init_privs entries reference any but built-in roles (or at least roles that'd likely outlive the extension). regards, tom lane