diff --git a/changelog/28519.txt b/changelog/28519.txt new file mode 100644 index 0000000000..9cd11f74ff --- /dev/null +++ b/changelog/28519.txt @@ -0,0 +1,3 @@ +```release-note:bug +database/postgresql: Fix potential error revoking privileges in postgresql database secrets engine when a schema contains special characters +``` diff --git a/plugins/database/postgresql/postgresql.go b/plugins/database/postgresql/postgresql.go index 004ca27dfc..ffe460f45c 100644 --- a/plugins/database/postgresql/postgresql.go +++ b/plugins/database/postgresql/postgresql.go @@ -529,7 +529,7 @@ func (p *PostgreSQL) defaultDeleteUser(ctx context.Context, username string) err } revocationStmts = append(revocationStmts, fmt.Sprintf( `REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA %s FROM %s;`, - (schema), + dbutil.QuoteIdentifier(schema), dbutil.QuoteIdentifier(username))) revocationStmts = append(revocationStmts, fmt.Sprintf(