@@ -95,13 +95,9 @@ create user postgres_ai_mon with password '<password>';
9595grant connect on database < database_name> to postgres_ai_mon;
9696
9797grant pg_monitor to postgres_ai_mon;
98- grant select on pg_stat_statements to postgres_ai_mon;
99- grant select on pg_stat_database to postgres_ai_mon;
100- grant select on pg_stat_user_tables to postgres_ai_mon;
101- grant select on pg_stat_user_indexes to postgres_ai_mon;
10298grant select on pg_index to postgres_ai_mon;
10399
104- -- Create a public view for pg_statistic access (required for bloat metrics on user schemas )
100+ -- Create a public view for pg_statistic access (optional, for bloat analysis )
105101create view public .pg_statistic as
106102select
107103 n .nspname as schemaname,
@@ -116,11 +112,29 @@ join pg_namespace n on n.oid = c.relnamespace
116112join pg_attribute a on a .attrelid = s .starelid and a .attnum = s .staattnum
117113where a .attnum > 0 and not a .attisdropped ;
118114
119- grant select on public .pg_statistic to pg_monitor ;
115+ grant select on public .pg_statistic to postgres_ai_mon ;
120116alter user postgres_ai_mon set search_path = " $user" , public, pg_catalog;
121117commit ;
122118```
123119
120+ ### Optional permissions to analyze risks of certain performance cliffs
121+
122+ For RDS Postgres and Aurora:
123+
124+ ``` sql
125+ create extension if not exists rds_tools;
126+ grant execute on function rds_tools .pg_ls_multixactdir () to postgres_ai_mon;
127+ ```
128+
129+ For self-managed Postgres:
130+
131+ ``` sql
132+ grant execute on function pg_stat_file(text ) to postgres_ai_mon;
133+ grant execute on function pg_stat_file(text , boolean ) to postgres_ai_mon;
134+ grant execute on function pg_ls_dir(text ) to postgres_ai_mon;
135+ grant execute on function pg_ls_dir(text , boolean , boolean ) to postgres_ai_mon;
136+ ```
137+
124138** One command setup:**
125139
126140``` bash
0 commit comments