Re: is_superuser versus set_config_option's parallelism check - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: is_superuser versus set_config_option's parallelism check
Date
Msg-id ZrZtdPcy2eEhcKr-@nathan
Whole thread Raw
In response to is_superuser versus set_config_option's parallelism check  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: is_superuser versus set_config_option's parallelism check
List pgsql-hackers
On Fri, Aug 09, 2024 at 02:43:59PM -0400, Tom Lane wrote:
> The simplest fix would be to hack this test to allow the action anyway
> when context == PGC_INTERNAL, excusing that as "assume the caller
> knows what it's doing".  That feels pretty grotty though.  Perhaps
> a cleaner way would be to move this check to some higher code level,
> but I'm not sure where would be a good place.

From a couple of quick tests, it looks like setting
"current_role_is_superuser" directly works.  That's still grotty, but at
least the grottiness would be localized and not require broad assumptions
about callers knowing what they're doing when using PGC_INTERNAL.  I
wouldn't be surprised if there are other problems with this approach, too.

-- 
nathan



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Restart pg_usleep when interrupted
Next
From: Bertrand Drouvot
Date:
Subject: Re: Restart pg_usleep when interrupted