mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user