File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -48,22 +48,22 @@ grant select on pg_stat_database to postgres_ai_mon;
4848grant select on pg_stat_user_tables to postgres_ai_mon;
4949
5050-- Create a public view for pg_statistic access (required for bloat metrics on user schemas)
51- CREATE VIEW public .pg_statistic AS
52- SELECT
51+ create view public .pg_statistic as
52+ select
5353 n .nspname as schemaname,
5454 c .relname as tablename,
5555 a .attname ,
5656 s .stanullfrac as null_frac,
5757 s .stawidth as avg_width,
5858 false as inherited
59- FROM pg_statistic s
60- JOIN pg_class c ON c .oid = s .starelid
61- JOIN pg_namespace n ON n .oid = c .relnamespace
62- JOIN pg_attribute a ON a .attrelid = s .starelid AND a .attnum = s .staattnum
63- WHERE a .attnum > 0 AND NOT a .attisdropped ;
64-
65- GRANT SELECT ON public .pg_statistic TO pg_monitor;
66- ALTER USER postgres_ai_mon set search_path = " $user" , public, pg_catalog;
59+ from pg_statistic s
60+ join pg_class c on c .oid = s .starelid
61+ join pg_namespace n on n .oid = c .relnamespace
62+ join pg_attribute a on a .attrelid = s .starelid and a .attnum = s .staattnum
63+ where a .attnum > 0 and not a .attisdropped ;
64+
65+ grant select on public .pg_statistic to pg_monitor;
66+ alter user postgres_ai_mon set search_path = " $user" , public, pg_catalog;
6767```
6868
6969** One command setup:**
You can’t perform that action at this time.
0 commit comments