Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER - Mailing list pgsql-hackers

From Robert Haas
Subject Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER
Date
Msg-id CA+TgmoYBTVZzchPhwmfgNhMMvVvon4EFA0e+p-7hdkMO4jKQdw@mail.gmail.com
Whole thread Raw
In response to Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Jul 26, 2022 at 2:59 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I had not actually read the patch, but now that I have, it's got
> a basic typing error:
>
> +       bool    should_be_super = BoolGetDatum(boolVal(dissuper->arg));
> +
> +       if (!should_be_super && roleid == BOOTSTRAP_SUPERUSERID)
> +           ereport(ERROR,
>
> The result of BoolGetDatum is not bool, it's Datum.  This is
> probably harmless, but it's still a typing violation.
> You want something like
>
>         bool    should_be_super = boolVal(dissuper->arg);
>         ...
>         new_record[Anum_pg_authid_rolsuper - 1] = BoolGetDatum(should_be_super);

Oops. Will fix.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER
Next
From: Robert Haas
Date:
Subject: Re: making relfilenodes 56 bits