summaryrefslogtreecommitdiff
path: root/src/backend/catalog/system_views.sql
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2021-10-27 12:37:09 -0700
committerJeff Davis <jdavis@postgresql.org>2021-10-27 14:06:30 -0700
commit77ea4f94393eb4a16df32b573bf053bedaef2e09 (patch)
treec4849ddde9fbba92cbf1ea620741cb48ede59123 /src/backend/catalog/system_views.sql
parent8af57ad81578f825ac8c46840c841833db205106 (diff)
downloadpostgresql-77ea4f94393eb4a16df32b573bf053bedaef2e09.tar.gz
Grant memory views to pg_read_all_stats.
Grant privileges on views pg_backend_memory_contexts and pg_shmem_allocations to the role pg_read_all_stats. Also grant on the underlying functions that those views depend on. Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Reviewed-by: Nathan Bossart <bossartn@amazon.com> Discussion: https://postgr.es/m/CALj2ACWAZo3Ar_EVsn2Zf9irG+hYK3cmh1KWhZS_Od45nd01RA@mail.gmail.com
Diffstat (limited to 'src/backend/catalog/system_views.sql')
-rw-r--r--src/backend/catalog/system_views.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 55f6e3711d..eb560955cd 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -621,13 +621,17 @@ CREATE VIEW pg_shmem_allocations AS
SELECT * FROM pg_get_shmem_allocations();
REVOKE ALL ON pg_shmem_allocations FROM PUBLIC;
+GRANT SELECT ON pg_shmem_allocations TO pg_read_all_stats;
REVOKE EXECUTE ON FUNCTION pg_get_shmem_allocations() FROM PUBLIC;
+GRANT EXECUTE ON FUNCTION pg_get_shmem_allocations() TO pg_read_all_stats;
CREATE VIEW pg_backend_memory_contexts AS
SELECT * FROM pg_get_backend_memory_contexts();
REVOKE ALL ON pg_backend_memory_contexts FROM PUBLIC;
+GRANT SELECT ON pg_backend_memory_contexts TO pg_read_all_stats;
REVOKE EXECUTE ON FUNCTION pg_get_backend_memory_contexts() FROM PUBLIC;
+GRANT EXECUTE ON FUNCTION pg_get_backend_memory_contexts() TO pg_read_all_stats;
-- Statistics views