Skip to content

Commit 60af74a

Browse files
fix: apply extension view filter to scanSchema as well as getTablesAndViews
The scanSchema() method had a separate SQL query that was not filtered, causing pg_stat_statements to appear in the Unresolved panel of the Brain section. Applied the same excludeExtensionViewsPredicate filter. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent ef1475c commit 60af74a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎backend/src/main/java/com/dbaagent/provider/postgres/PostgresIntrospectionProvider.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ public SchemaMetadata scanSchema(Connection connection, String database) throws
461461
schema.setDatabaseName(database);
462462

463463
// Get all tables and views across non-system schemas (W2a).
464+
// Views are further filtered to exclude extension-created system views.
464465
String tablesQuery = "SELECT t.schemaname, t.tablename, 'table' as type, "
465466
+ "pg_total_relation_size(quote_ident(t.schemaname)||'.'||quote_ident(t.tablename)) as size_bytes, "
466467
+ "CASE "
@@ -477,7 +478,7 @@ public SchemaMetadata scanSchema(Connection connection, String database) throws
477478
+ "UNION ALL "
478479
+ "SELECT v.schemaname, v.viewname as tablename, 'view' as type, 0 as size_bytes, 0 as row_count "
479480
+ "FROM pg_views v "
480-
+ "WHERE " + nonSystemSchemaPredicate("v.schemaname") + " "
481+
+ "WHERE " + nonSystemSchemaPredicate("v.schemaname") + " AND " + excludeExtensionViewsPredicate("v.viewname") + " "
481482
+ "ORDER BY schemaname, tablename";
482483

483484
Map<String, TableMetadata> tableMap = new HashMap<>();

0 commit comments

Comments
 (0)