fix: automatic column additions, permissions grants and docs updates for seamless upgrades

This commit is contained in:
Maksym Buz
2026-05-05 17:56:57 +00:00
parent 345495eaf5
commit 96c087b920
6 changed files with 75 additions and 25 deletions

View File

@@ -31,3 +31,12 @@ LEFT JOIN pg_inherits ON pg_inherits.inhparent = parent.oid
LEFT JOIN pg_class child ON pg_inherits.inhrelid = child.oid
WHERE parent.relkind = 'p' -- Only partitioned tables
GROUP BY parent.relname, c.table_name, c.period, c.keep_history, c.future_partitions, c.last_updated;
-- ============================================================================
-- IMPORTANT: Since DROP VIEW / CREATE VIEW resets permissions, we automatically
-- grant read access to PUBLIC. This ensures that whatever monitoring user
-- (e.g. zbx_monitor) is connecting to the DB will always be able to read
-- the monitoring stats without manual intervention after upgrades.
-- ==========================================================================
GRANT USAGE ON SCHEMA partitions TO PUBLIC;
GRANT SELECT ON partitions.monitoring TO PUBLIC;