From c6f0705ae82793584344141b630253682e051406 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mart=C3=ADn=20Marqu=C3=A9s?=
 <martin.marques@2ndquadrant.com>
Date: Tue, 2 Jun 2020 12:43:02 -0300
Subject: [PATCH v2 2/4] We want the monitoring role `pg_read_all_stats` to be
 able to SELECT from `pg_replication_origin_status`.

This will help so output diagnostics and monitoring tools can be able to
gather replication origins status without requiring superuser privileges
---
 src/backend/catalog/system_views.sql | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 6658f0c2eb2..995bb5663fc 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1497,3 +1497,5 @@ GRANT EXECUTE ON FUNCTION pg_ls_tmpdir(oid) TO pg_monitor;
 GRANT pg_read_all_settings TO pg_monitor;
 GRANT pg_read_all_stats TO pg_monitor;
 GRANT pg_stat_scan_tables TO pg_monitor;
+
+GRANT SELECT ON pg_replication_origin_status TO pg_read_all_stats;
-- 
2.21.3

