public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ayush Vatsa <[email protected]>
To: Tom Lane <[email protected]>
To: David G. Johnston <[email protected]>
To: Robert Haas <[email protected]>
Cc: [email protected]
Subject: Re: Clarification on Role Access Rights to Table Indexes
Date: Tue, 18 Feb 2025 00:09:33 +0530
Message-ID: <CACX+KaNQ9ahSb-TP-N2RELD4wFNGuXHx7C7t+Dtf_zeGSLDybw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CACX+KaMz2ZoOojh0nQ6QNBYx8Ak1Dkoko=D4FSb80BYW+o8CHQ@mail.gmail.com>
	<[email protected]>

> This is pointless, everyone (i.e. the PUBLIC pseudo-role) can already
read pg_class.
True, Just checked that.

> It fails because AFAICS there is no way for it to work on an index, only
tables.
pg_prewarm extension works on index if we have right (SELECT) privileges
postgres=# CREATE TABLE x(id INT);
CREATE TABLE
postgres=# CREATE INDEX idx ON x(id);
CREATE INDEX

postgres=# INSERT INTO x SELECT * FROM generate_series(1,10000);
INSERT 0 10000
postgres=# SELECT pg_prewarm('x');
 pg_prewarm
------------
         45
(1 row)

postgres=# SELECT pg_prewarm('idx');
 pg_prewarm
------------
         30
(1 row)

> It seems like ownership of the table would be more appropriate, or maybe
> access to one of the built-in roles like pg_maintain.
True, adding Robert Haas (author) to this thread for his opinion.

Regards,
Ayush Vatsa
SDE AWS


view thread (15+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Clarification on Role Access Rights to Table Indexes
  In-Reply-To: <CACX+KaNQ9ahSb-TP-N2RELD4wFNGuXHx7C7t+Dtf_zeGSLDybw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox