Re: Clarification on Role Access Rights to Table Indexes - Mailing list pgsql-general

From Ayush Vatsa
Subject Re: Clarification on Role Access Rights to Table Indexes
Date
Msg-id CACX+KaNQ9ahSb-TP-N2RELD4wFNGuXHx7C7t+Dtf_zeGSLDybw@mail.gmail.com
Whole thread Raw
In response to Re: Clarification on Role Access Rights to Table Indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Clarification on Role Access Rights to Table Indexes
Next
From: "David G. Johnston"
Date:
Subject: Re: Clarification on Role Access Rights to Table Indexes