Skip to content

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

fix: use correct regexp to check VACUUM statements (#13664)

rebeliceffc814320b42
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index df8469ca81..26c0c444aa 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -582,7 +582,7 @@ var (
// VACUUM cannot run inside a transaction block.
// VACUUM [ ( option [, ...] ) ] [ table_and_columns [, ...] ]
// VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ table_and_columns [, ...] ].
- vacuumReg = regexp.MustCompile(`(?i)VACUUM`)
+ vacuumReg = regexp.MustCompile(`(?i)^\s*VACUUM`)
// SET ROLE is a special statement that should be run before any other statements containing inside a transaction block or not.
setRoleReg = regexp.MustCompile(`(?i)SET\s+((SESSION|LOCAL)\s+)?ROLE`)
)