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