Re: Allow pg_read_all_stats to read replication origin status - Mailing list pgsql-hackers

From Virender Singla
Subject Re: Allow pg_read_all_stats to read replication origin status
Date
Msg-id CAM6Zo8zrOuehNZXfaYY16JP1+jWjbOLUZS3xyoRCGkNqbHJfTg@mail.gmail.com
Whole thread
In response to RE: Allow pg_read_all_stats to read replication origin status  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: Allow pg_read_all_stats to read replication origin status
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Nazir Bilal Yavuz
Date:
Subject: Stabilize and shorten test_checksums/013_rewind test