Re: is_superuser versus set_config_option's parallelism check

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: is_superuser versus set_config_option's parallelism check
Дата
Msg-id ZrZtdPcy2eEhcKr-@nathan
обсуждение исходный текст
Ответ на is_superuser versus set_config_option's parallelism check  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: is_superuser versus set_config_option's parallelism check
Список 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 по дате отправления: