Hi Virender, > I observed that there are other similar views granted read privileges > to pg_read_all_stats [1]. Views like pg_shmem_allocations, > pg_backend_memory_contexts, and pg_aios are real-time, point-in-time > snapshots of the system's internal state. It looks like the definition > of "stats" for this role has practically evolved to cover general > system observability, monitoring, and telemetry data.
For me pg_shmem_allocations and pg_backend_memory_contexts are something like a statistics because they show the size of total allocated memory. But, hmm, pg_aios might be a good example. > Also, pg_read_all_stats is granted to pg_monitor anyway. Yes, IIUC pg_monitor is a superset of the pg_read_all_stats. > There actually was prior discussion on granting this to > pg_read_all_stats instead of pg_monitor. However, the work was split > across multiple changes. The first change, which related to removing > the hardcoded superuser check, was committed, but the thread stalled > before the second change (granting access to pg_read_all_stats) could > be completed. While checking the old discussion, there was alternative approach to export the pg_replication_origin_status to public [1], which might also be good. local_id is an internal identifier which is not sensitive, external_id is already public on pg_replication_origin, and remote/local_lsn are also visible on other views. Can you evaluate it also? [1]: https://www.postgresql.org/message-id/20200608.174456.238992210909952383.horikyota.ntt%40gmail.com Best regards, Hayato Kuroda FUJITSU LIMITED
