Re: Fix search_path for all maintenance commands

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Fix search_path for all maintenance commands
Дата
Msg-id CAM-w4HM8gsWgZOhCxjhLpvmrMSE1o6to7c6n55D76wfCP_JMSQ@mail.gmail.com
обсуждение исходный текст
Ответ на Fix search_path for all maintenance commands  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Fix search_path for all maintenance commands  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Fri, 26 May 2023 at 19:22, Jeff Davis <pgsql@j-davis.com> wrote:
>
> Maintenance commands (ANALYZE, CLUSTER, REFRESH MATERIALIZED VIEW,
> REINDEX, and VACUUM) currently run as the table owner, and as a
> SECURITY_RESTRICTED_OPERATION.
>
> I propose that we also fix the search_path to "pg_catalog, pg_temp"
> when running maintenance commands, for two reasons:
>
> 1. Make the behavior of maintenance commands more consistent because
> they'd always have the same search_path.

What exactly would this impact? Offhand... expression indexes where
the functions in the expression (which would already be schema
qualified) themselves reference other objects without schema
qualification?

So this would negatively affect someone who was using such a dangerous
function definition but was careful to always use the same search_path
on it. Perhaps someone who had created an expression index on their
own table in their own schema calling their own functions in their own
schema. As long as nobody else ever calls it that would work but this
would cause superuser to no longer be able to reindex it even if
superuser set the same search_path?

I guess that's pretty narrow and a reasonable thing to desupport.
Users could just mark those functions with search_path or schema
qualify the object references in them. Perhaps we should also be
picking up cases like that sooner so users realize they've created a
footgun for themselves?

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Order changes in PG16 since ICU introduction
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: index prefetching