[PATCH] allow pg_current_logfile() execution under pg_monitor role - Mailing list pgsql-hackers

From Pavlo Golub
Subject [PATCH] allow pg_current_logfile() execution under pg_monitor role
Date
Msg-id CAK7ymcLmEYWyQkiCZ64WC-HCzXAB0omM=Ypj9B3rXe8vUAFMqw@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] allow pg_current_logfile() execution under pg_monitor role
List pgsql-hackers
Hello,

The patch attached fixes an oversight/inconsistency of disallowing the pg_monitor system role to execute pg_current_logfile([text]).

pgwatch3=# create user joe;
CREATE ROLE
pgwatch3=# set role joe;
SET
pgwatch3=> select pg_current_logfile();
ERROR:  permission denied for function pg_current_logfile
pgwatch3=> reset role;
RESET
pgwatch3=# grant pg_monitor to joe;
GRANT ROLE
pgwatch3=# set role joe;
SET
pgwatch3=> select pg_current_logfile();
ERROR:  permission denied for function pg_current_logfile
pgwatch3=> select * FROM pg_ls_logdir();
               name               |   size   |      modification
----------------------------------+----------+------------------------
 postgresql-2024-02-08_130906.log |      652 | 2024-02-08 13:10:04+01
(5 rows)

Best regards,
Pavlo Golub
Attachment

pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: failure in 019_replslot_limit
Next
From: Masahiko Sawada
Date:
Subject: Re: Improve eviction algorithm in ReorderBuffer