Hi,
Thanks for the discussion and sorry for the late reply. It seems OK to grant to
pg_read_all_stats role.
I cannot find examples to grant only for pg_monitor role in system views.
Some functions which report file name, like pg_ls_logdir and
pg_ls_replslotdir(),
are granted for pg_monitor but pg_replication_origin_status is bit different
from them. So it seems not appropriate for us.
Regarding the PUBLIC/pg_read_all_stats options, actually I cannot come up
with good reasons to choose them but we can go with the conservative approach.
For now let's not to export PUBLIC.
Few comments for your patch:
01.
```
+GRANT EXECUTE ON FUNCTION pg_show_replication_origin_status() TO
pg_read_all_stats;
```
I cannot find existing examples to GRANT EXECUTION in the file. Per my quick
lookup it's controled under the pg_proc.dat.
02.
```
+SELECT
has_function_privilege('regress_readallstats','pg_show_replication_origin_status()','EXECUTE');
-- no
```
Do we have to check the internal function? E.g., a view
pg_dsm_registry_allocations
is a wrapper of pg_get_dsm_registry_allocations but the latter one is not
tested.
Best regards,
Hayato Kuroda
FUJITSU LIMITED