Skip to content

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

fix: fix pg role (#15648)

rebelice376ede50e622
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index cc0d57f1ea..08328db9a6 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -354,7 +354,7 @@ func (d *Driver) Execute(ctx context.Context, statement string, opts db.ExecuteO
nonTransactionAndSetRoleStmts = append(nonTransactionAndSetRoleStmts, command.Text)
nonTransactionAndSetRoleStmtsIndex = append(nonTransactionAndSetRoleStmtsIndex, originalIndex[i])
continue
- case isSuperuserStatement(command.Text):
+ case isSuperuserStatement(command.Text) && d.connectionCtx.UseDatabaseOwner:
// Use superuser privilege to run privileged statements.
slog.Info("Use superuser privilege to run privileged statements", slog.String("statement", command.Text))
ct := command.Text