Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGPmG-0001Sc-4n for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 18:59:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGPmE-0005Ti-6w for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 18:59:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGPmD-0005TS-TB for pgsql-hackers@lists.postgresql.org; Tue, 26 Jul 2022 18:59:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGPmB-0001Li-Cn for pgsql-hackers@postgresql.org; Tue, 26 Jul 2022 18:59:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26QIxOXD2511600; Tue, 26 Jul 2022 14:59:24 -0400 From: Tom Lane To: Robert Haas cc: Nathan Bossart , "pgsql-hackers@postgresql.org" Subject: Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER In-reply-to: References: <39752.1658420887@sss.pgh.pa.us> <75372.1658422970@sss.pgh.pa.us> <20220721172726.GA3779763@nathanxps13> Comments: In-reply-to Robert Haas message dated "Tue, 26 Jul 2022 14:40:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2511598.1658861964.1@sss.pgh.pa.us> Date: Tue, 26 Jul 2022 14:59:24 -0400 Message-ID: <2511599.1658861964@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > Reaction to this patch seems tentatively positive so far, so I have > committed it. Maybe someone will still show up to complain ... but I > think it's a good change, so I hope not. 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); regards, tom lane