feat: enterprise audit fixes (schema resolution, race conditions, documentation)

This commit is contained in:
Maksym Buz
2026-04-30 10:49:53 +00:00
parent 59b2780125
commit c401efea51
9 changed files with 232 additions and 54 deletions

View File

@@ -2,8 +2,7 @@
-- Creates a view to monitor partition status and sizes.
-- ============================================================================
DROP VIEW IF EXISTS partitions.monitoring;
CREATE VIEW partitions.monitoring AS
CREATE OR REPLACE VIEW partitions.monitoring AS
SELECT
parent.relname AS parent_table,
c.table_name,
@@ -27,7 +26,7 @@ SELECT
max(child.relname) AS newest_partition,
c.last_updated
FROM partitions.config c
JOIN pg_class parent ON parent.relname = c.table_name
JOIN pg_class parent ON parent.relname = c.table_name AND pg_table_is_visible(parent.oid)
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