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 1tr2UN-00DppW-12 for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Mar 2025 22:17:47 +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 1tr2UK-00ALub-HR for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Mar 2025 22:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tr2UK-00ALuT-6s for pgsql-hackers@lists.postgresql.org; Sat, 08 Mar 2025 22:17:44 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tr2UI-001klc-19 for pgsql-hackers@postgresql.org; Sat, 08 Mar 2025 22:17:43 +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 528MHeUQ149430; Sat, 8 Mar 2025 17:17:40 -0500 From: Tom Lane To: Nathan Bossart cc: Ayush Vatsa , Robert Haas , "David G. Johnston" , PostgreSQL Hackers Subject: Re: Clarification on Role Access Rights to Table Indexes In-reply-to: References: <1243984.1739894558@sss.pgh.pa.us> <1246906.1739896202@sss.pgh.pa.us> Comments: In-reply-to Nathan Bossart message dated "Sat, 08 Mar 2025 15:57:25 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <149428.1741472260.1@sss.pgh.pa.us> Date: Sat, 08 Mar 2025 17:17:40 -0500 Message-ID: <149429.1741472260@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > I do see a concern upthread about increased deadlock risk [0], but your > patch doesn't lock the table, but unless I'm wrong [1] (which is always > possible), it doesn't need to lock it. It bothers me a bit that this proposes to do something as complicated as pg_class_aclcheck on a table we have no lock on. As you say, the lock we hold on the index would prevent DROP TABLE, but that doesn't mean we won't have any issues with other DDL on the table. Still, taking a lock would be bad because of the deadlock hazard, and I think the potential for conflicts with concurrent DDL is nonzero in a lot of other places. So I don't have any concrete reason to object. ReindexIndex() faces this same problem and solves it with some very complex code that manages to get the table's lock first. But I see that it's also doing pg_class_aclcheck on a table it hasn't locked yet, so I don't think that adopting its approach would do anything useful for us here. regards, tom lane