Thanks Hayato for taking a look. > Not sure, does pg_replication_origin_status contain statistics? I expected > statistics means some cumulative data, but this view contains node ids and > LSNs.
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. Also, pg_read_all_stats is granted to pg_monitor anyway. > Can you give us a background why the idea allowing pg_monitor to read the view > was not accepted? 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. [1] https://github.com/postgres/postgres/blob/master/src/backend/catalog/system_views.sql Thanks, Virender
