mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix brain fade in e530be2c5c.
				
					
				
			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
This commit is contained in:
		@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user