summaryrefslogtreecommitdiff
path: root/src/backend/commands/user.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2022-07-26 15:10:25 -0400
committerRobert Haas <rhaas@postgresql.org>2022-07-26 15:12:09 -0400
commit8bb3ad462f8d53b67d2c4707e9dde6604a276bd9 (patch)
treee06388fd7c0e29fd19b9d6958f413ff089d41e6d /src/backend/commands/user.c
parentd8cd0c6c95c0120168df93aae095df4e0682a08a (diff)
Fix brain fade in e530be2c5ce77475d56ccf8f4e0c4872b666ad5f.
The BoolGetDatum() call ended up in the wrong place. It should be applied when we, err, want to convert a bool to a datum. Thanks to Tom Lane for noticing this. Discussion: http://postgr.es/m/2511599.1658861964@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r--src/backend/commands/user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 37260edbe48..94135fdd6b6 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -693,14 +693,14 @@ AlterRole(ParseState *pstate, AlterRoleStmt *stmt)
*/
if (dissuper)
{
- bool should_be_super = BoolGetDatum(boolVal(dissuper->arg));
+ bool should_be_super = boolVal(dissuper->arg);
if (!should_be_super && roleid == BOOTSTRAP_SUPERUSERID)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("permission denied: bootstrap user must be superuser")));
- new_record[Anum_pg_authid_rolsuper - 1] = should_be_super;
+ new_record[Anum_pg_authid_rolsuper - 1] = BoolGetDatum(should_be_super);
new_record_repl[Anum_pg_authid_rolsuper - 1] = true;
}