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 1tk5qC-00HUnn-86 for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 18:27:36 +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 1tk5qB-001MFt-0c for pgsql-general@arkaria.postgresql.org; Mon, 17 Feb 2025 18:27:35 +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 1tk5qA-001MFK-LW for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 18:27:34 +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 1tk5q8-001Oqg-1F for pgsql-general@lists.postgresql.org; Mon, 17 Feb 2025 18:27:34 +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 51HIRU3V855989; Mon, 17 Feb 2025 13:27:30 -0500 From: Tom Lane To: Ayush Vatsa cc: pgsql-general@lists.postgresql.org Subject: Re: Clarification on Role Access Rights to Table Indexes In-reply-to: References: Comments: In-reply-to Ayush Vatsa message dated "Mon, 17 Feb 2025 23:31:46 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <855987.1739816850.1@sss.pgh.pa.us> Date: Mon, 17 Feb 2025 13:27:30 -0500 Message-ID: <855988.1739816850@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayush Vatsa writes: > postgres=> SELECT pg_prewarm('pg_class_oid_index'); > ERROR: permission denied for index pg_class_oid_index You'd really have to take that up with the author of pg_prewarm. It's not apparent to me why checking SQL access permissions is the right mechanism for limiting use of pg_prewarm. It seems like ownership of the table would be more appropriate, or maybe access to one of the built-in roles like pg_maintain. > 1. Can a role have access rights to a table without having access to its > index? Indexes do not have access rights of their own, which is why access rights are a poor gating mechanism for something that needs to be applicable to indexes. Ownership could work, because we make indexes inherit their table's ownership. regards, tom lane