Skip to content

Commit 2db68fd

Browse files
committed
fix: stringify username and db name in sql
1 parent 52ef68f commit 2db68fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/postgres/audit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func enableAuditAsAppUser(ctx context.Context, appName, namespace, cluster strin
3636

3737
defer db.Close()
3838

39-
enableAudit := fmt.Sprintf(`CREATE EXTENSION IF NOT EXISTS pgaudit; ALTER USER %s IN DATABASE %s SET pgaudit.log TO 'none';`, connectionInfo.username, connectionInfo.dbName)
39+
enableAudit := fmt.Sprintf(`CREATE EXTENSION IF NOT EXISTS pgaudit; ALTER USER "%s" IN DATABASE "%s" SET pgaudit.log TO 'none';`, connectionInfo.username, connectionInfo.dbName)
4040
_, err = db.ExecContext(ctx, enableAudit)
4141
if err != nil {
4242
return fmt.Errorf("enableAuditAsAppUser: error enabling pgaudit: %w", err)

0 commit comments

Comments
 (0)