Skip to content

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

fix: nil pointer in pg schema state (#12063)

ecmadao146bf844baeb
diff --git a/backend/plugin/advisor/catalog/walk_through_for_pg.go b/backend/plugin/advisor/catalog/walk_through_for_pg.go
index 9440de9a85..02d90f5c0d 100644
--- a/backend/plugin/advisor/catalog/walk_through_for_pg.go
+++ b/backend/plugin/advisor/catalog/walk_through_for_pg.go
@@ -231,6 +231,7 @@ func (d *DatabaseState) pgCreateSchema(node *ast.CreateSchemaStmt) *WalkThroughE
}
schema := &SchemaState{
+ ctx: d.ctx.Copy(),
name: node.Name,
identifierMap: make(identifierMap),
tableSet: make(tableStateMap),
@@ -1017,6 +1018,7 @@ func (d *DatabaseState) getSchema(schemaName string) (*SchemaState, *WalkThrough
}
}
schema = &SchemaState{
+ ctx: d.ctx.Copy(),
name: publicSchemaName,
tableSet: make(tableStateMap),
viewSet: make(viewStateMap),