Skip to content

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

chore: catch pg_query_go Former-commit-id: 0cb9548d7f2daf2f1d595160f45491091c065097 Former-commit-id: 2bf3b8f0b53cf9ae7751b2f24ffaf097cb93335e

p0nyab9af4a6d010
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index 7519ff5514..1215e73276 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -771,6 +771,17 @@ func getStatementWithResultLimit(stmt string, limit int) string {
}
func isPlSQLBlock(stmt string) bool {
+ defer func() {
+ if r := recover(); r != nil {
+ perr, ok := r.(error)
+ if !ok {
+ perr = errors.Errorf("%v", r)
+ }
+ err := errors.Errorf("PANIC RECOVER, err: %v", perr)
+ stmtT, _ := common.TruncateString(stmt, 1000)
+ slog.Info("isPlSQLBlock panic", log.BBError(err), "stmt_truncated", stmtT)
+ }
+ }()
tree, err := pgquery.Parse(stmt)
if err != nil {
return false