mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Check for USAGE (instead of MEMBER) privilege in all pg_has_role occurrences
This commit is contained in:
committed by
Martín Marqués
parent
f69485c0ba
commit
4a28c57bc7
@@ -2024,13 +2024,13 @@ connection_has_pg_monitor_role(PGconn *conn, const char *subrole)
|
||||
initPQExpBuffer(&query);
|
||||
appendPQExpBufferStr(&query,
|
||||
" SELECT CASE "
|
||||
" WHEN pg_catalog.pg_has_role('pg_monitor','MEMBER') "
|
||||
" WHEN pg_catalog.pg_has_role('pg_monitor','USAGE') "
|
||||
" THEN TRUE ");
|
||||
|
||||
if (subrole != NULL)
|
||||
{
|
||||
appendPQExpBuffer(&query,
|
||||
" WHEN pg_catalog.pg_has_role('%s','MEMBER') "
|
||||
" WHEN pg_catalog.pg_has_role('%s','USAGE') "
|
||||
" THEN TRUE ",
|
||||
subrole);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user