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 1trIst-001U9b-Tu for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Mar 2025 15:48:11 +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 1trIss-009Imi-Ke for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Mar 2025 15:48:10 +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 1trIss-009Ima-AU for pgsql-hackers@lists.postgresql.org; Sun, 09 Mar 2025 15:48:10 +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.96) (envelope-from ) id 1trIso-001s89-2f for pgsql-hackers@postgresql.org; Sun, 09 Mar 2025 15:48:09 +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 529Fm5XP279948; Sun, 9 Mar 2025 11:48:06 -0400 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: <1246906.1739896202@sss.pgh.pa.us> <149429.1741472260@sss.pgh.pa.us> Comments: In-reply-to Nathan Bossart message dated "Sat, 08 Mar 2025 19:35:18 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <279946.1741535285.1@sss.pgh.pa.us> Date: Sun, 09 Mar 2025 11:48:05 -0400 Message-ID: <279947.1741535285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Sat, Mar 08, 2025 at 05:17:40PM -0500, Tom Lane wrote: >> ReindexIndex() faces this same problem and solves it with some >> very complex code that manages to get the table's lock first. > I noticed that amcheck's bt_index_check_internal() handles this problem, > ... > stats_lock_check_privileges() does something similar, but it's not as > cautious about the "heapid != IndexGetRelation(indrelid, false)" race > condition. Egad, we've already got three inconsistent implementations of this functionality? I think the first step must be to unify them into a common implementation, if at all possible. regards, tom lane