Skip to content

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

fix: revert some changes in #16940 (#17290)

h3n4laa1b2e3e995c
diff --git a/backend/plugin/parser/pg/legacy/convert.go b/backend/plugin/parser/pg/legacy/convert.go
index 738f41976f..3aafcd3e6f 100644
--- a/backend/plugin/parser/pg/legacy/convert.go
+++ b/backend/plugin/parser/pg/legacy/convert.go
@@ -240,7 +240,6 @@ func convert(node *pgquery.Node, statement base.SingleSQL) (res ast.Node, err er
NewName: in.RenameStmt.Newname,
}, nil
default:
- return nil, NewConvertErrorf("unsupported rename type %v", in.RenameStmt.RenameType)
}
case *pgquery.Node_IndexStmt:
indexDef := &ast.IndexDef{
@@ -473,7 +472,6 @@ func convert(node *pgquery.Node, statement base.SingleSQL) (res ast.Node, err er
return dropTypeStmt, nil
default:
- return nil, NewConvertErrorf("unsupported drop type %v", in.DropStmt.RemoveType)
}
case *pgquery.Node_DropdbStmt:
return &ast.DropDatabaseStmt{
diff --git a/backend/plugin/parser/pg/legacy/deparse.go b/backend/plugin/parser/pg/legacy/deparse.go
index 11c85e902f..2a5c430ffa 100644
--- a/backend/plugin/parser/pg/legacy/deparse.go
+++ b/backend/plugin/parser/pg/legacy/deparse.go
@@ -322,7 +322,6 @@ func deparseIndexMethod(method ast.IndexMethodType, buf *strings.Builder) (err e
case ast.IndexMethodTypeIvfflat:
_, err = buf.WriteString("ivfflat")
default:
- return errors.Errorf("unsupported index method type: %v", method)
}
return err
}
@@ -348,7 +347,6 @@ func deparseIndexKey(context DeparseContext, in *ast.IndexKeyDef, buf *strings.B
return err
}
default:
- return errors.Errorf("unsupported index key type: %v", in.Type)
}
if in.SortOrder == ast.SortOrderTypeDescending {
@@ -714,7 +712,6 @@ func deparseConstraintDef(_ DeparseContext, in *ast.ConstraintDef, buf *strings.
return err
}
default:
- return errors.Errorf("unsupported constraint type: %v", in.Type)
}
return nil
}
@@ -751,7 +748,6 @@ func deparseReferentialAction(_ DeparseContext, prefix string, in *ast.Referenti
return err
}
default:
- return errors.Errorf("unsupported referential action type: %v", in.Type)
}
return nil
}
@@ -769,7 +765,6 @@ func deparseForeignMatchType(_ DeparseContext, in ast.ForeignMatchType, buf *str
return err
}
default:
- return errors.Errorf("unsupported foreign match type: %v", in)
}
return nil
}
@@ -968,7 +963,6 @@ func deparsePartitionDef(_ DeparseContext, in *ast.PartitionDef, buf *strings.Bu
case pgquery.PartitionStrategy_PARTITION_STRATEGY_HASH:
strategy = "HASH"
default:
- return errors.Errorf("unsupported partition strategy: %v", in.Strategy)
}
if _, err := buf.WriteString(strategy); err != nil {
return err
@@ -998,7 +992,6 @@ func deparsePartitionDef(_ DeparseContext, in *ast.PartitionDef, buf *strings.Bu
return err
}
default:
- return errors.Errorf("unsupported partition key type: %v", key.Type)
}
}
if _, err := buf.WriteString(")"); err != nil {
@@ -1519,7 +1512,6 @@ func deparseAddEnumValue(_ DeparseContext, in *ast.AddEnumLabelStmt, buf *string
return err
}
default:
- return errors.Errorf("unsupported position type: %v", in.Position)
}
return writeSurrounding(buf, in.NeighborLabel, "'")
}
@@ -1840,7 +1832,6 @@ func deparseRoleSpec(_ DeparseContext, in *ast.RoleSpec, buf *strings.Builder) e
return err
}
default:
- return errors.Errorf("unsupported role spec type: %v", in.Type)
}
}
return nil