feat: enterprise audit fixes (schema resolution, race conditions, documentation)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user