Re: Clarification on Role Access Rights to Table Indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Clarification on Role Access Rights to Table Indexes
Date: 2025-02-17 18:27:30
Message-ID: 855988.1739816850@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Ayush Vatsa <ayushvatsa1810(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ayush Vatsa 2025-02-17 18:39:33 Re: Clarification on Role Access Rights to Table Indexes
Previous Message David G. Johnston 2025-02-17 18:17:16 Clarification on Role Access Rights to Table Indexes

Browse pgsql-hackers by date

  From Date Subject
Next Message Alena Rybakina 2025-02-17 18:36:14 Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)
Previous Message David G. Johnston 2025-02-17 18:17:16 Clarification on Role Access Rights to Table Indexes