Skip to content

Commit e06dd0c

Browse files
robertmhaaspull[bot]
authored andcommitted
Fix brain fade in e530be2.
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
1 parent 56e68f5 commit e06dd0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/commands/user.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,14 +693,14 @@ AlterRole(ParseState *pstate, AlterRoleStmt *stmt)
693693
*/
694694
if (dissuper)
695695
{
696-
bool should_be_super = BoolGetDatum(boolVal(dissuper->arg));
696+
bool should_be_super = boolVal(dissuper->arg);
697697

698698
if (!should_be_super && roleid == BOOTSTRAP_SUPERUSERID)
699699
ereport(ERROR,
700700
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
701701
errmsg("permission denied: bootstrap user must be superuser")));
702702

703-
new_record[Anum_pg_authid_rolsuper - 1] = should_be_super;
703+
new_record[Anum_pg_authid_rolsuper - 1] = BoolGetDatum(should_be_super);
704704
new_record_repl[Anum_pg_authid_rolsuper - 1] = true;
705705
}
706706

0 commit comments

Comments
 (0)