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 1tkQUN-003pGA-GE for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 16:30:27 +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 1tkQUM-00C9YP-7Y for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 16:30:26 +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 1tkQU1-00C6Eu-8q for pgsql-hackers@lists.postgresql.org; Tue, 18 Feb 2025 16:30:05 +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 1tkQTz-001Y3e-17 for pgsql-hackers@postgresql.org; Tue, 18 Feb 2025 16:30:04 +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 51IGU2Vw1246907; Tue, 18 Feb 2025 11:30:02 -0500 From: Tom Lane To: Robert Haas cc: "David G. Johnston" , Ayush Vatsa , PostgreSQL Hackers Subject: Re: Clarification on Role Access Rights to Table Indexes In-reply-to: References: <855988.1739816850@sss.pgh.pa.us> <861660.1739819589@sss.pgh.pa.us> <908583.1739822263@sss.pgh.pa.us> <934709.1739829723@sss.pgh.pa.us> <1243984.1739894558@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 18 Feb 2025 11:21:33 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1246905.1739896202.1@sss.pgh.pa.us> Date: Tue, 18 Feb 2025 11:30:02 -0500 Message-ID: <1246906.1739896202@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > That is a +1 for the specific design of "check SELECT on the index's > table". I don't want to be closed-minded: if you have some strong > reason for believing that's the wrong thing to do, I'm all ears. > However, I'm presently of the view that it is exactly the right thing > to do, to the point where I don't currently understand why there's > anything to think about here. I have no objection to it, but I wasn't as entirely convinced as you are that it's the only plausible answer. One specific thing I'm slightly worried about is that a naive implementation would probably cause this function to lock the table after the index, risking deadlock against queries that take the locks in the more conventional order. I don't recall what if anything we've done about that in other places (-ENOCAFFEINE). regards, tom lane