Fix potential error revoking privileges in postgres secret engine (#28519)

* Fix potential error revoking privileges in postgres secret engine

* add changelog entry

* fix changelog format

---------

Co-authored-by: JM Faircloth <jmfaircloth@hashicorp.com>
This commit is contained in:
Lee Boynton
2024-09-26 22:08:14 +01:00
committed by GitHub
parent 6dfde31f94
commit 55dac2a319
2 changed files with 4 additions and 1 deletions

3
changelog/28519.txt Normal file
View File

@@ -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
```

View File

@@ -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(