Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(pg-parser): handle nil index metadata in DropIndexStmt (#16701)

Danny Xua1fc084e1ad0
diff --git a/backend/plugin/parser/pg/resource_change.go b/backend/plugin/parser/pg/resource_change.go
index 613de0c479..21389faf7d 100644
--- a/backend/plugin/parser/pg/resource_change.go
+++ b/backend/plugin/parser/pg/resource_change.go
@@ -241,6 +241,9 @@ func collectResourceChanges(database string, searchPath []string, node ast.Node,
)
} else {
schema, indexMetadata := databaseMetadata.SearchIndex(searchPath, index.Name)
+ if indexMetadata == nil {
+ continue
+ }
tableMetadata := indexMetadata.GetTableProto()
if tableMetadata == nil {
continue