Re: pg_dump does not honor namespaces when functions are used in index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump does not honor namespaces when functions are used in index
Дата
Msg-id 3959.1276787300@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_dump does not honor namespaces when functions are used in index  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: pg_dump does not honor namespaces when functions are used in index  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I suppose that the root of the problem here is that foo() is not
> really immutable - it gives different results depending on the search
> path.

Yeah.  The declaration of the function is broken --- it's not pg_dump's
fault that the function misbehaves.

> I actually wonder if we shouldn't automatically tag plpgsql functions
> with the search_path in effect at the time of their creation (as if
> the user had done ALTER FUNCTION ... SET search_path=...whatever the
> current search path is...).

That would be extremely expensive and not very backwards-compatible.
In the case at hand, just writing "RETURN bar.bar();" would be the
best-performing solution.
        regards, tom lane


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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: ANNOUNCE list (was Re: New PGXN Extension site)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Should the JSON datatype be a specialization of text?