Re: [BUGS] BUG #14649: Function Namespace Resolution Bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14649: Function Namespace Resolution Bug
Дата
Msg-id 9062.1494619851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14649: Function Namespace Resolution Bug  (Jeremy Cowgar <jeremy@cowgar.com>)
Список pgsql-bugs
Jeremy Cowgar <jeremy@cowgar.com> writes:
> I didn’t realize that pg_dump alters the search path. Couldn’t pg_dump
> simply append the default search path to the end of it’s custom setting?

There's no particularly good reason to believe that there's a single
"default" search_path that would apply to all usages in a given database.
Even if there were, sticking another schema in front of it wouldn't
produce the same results, ie if you have code that fails when the
search_path isn't "f, g, h", it may well fail when the search_path is
"g, f, g, h", because schema g would win ambiguous references over
schema f.

We could maybe make this work if pg_dump never touched the search_path
at all, but that would be a quite subtle change creating its own set of
hazards.

The long and the short of it is that code in CHECK constraints (or
triggers) is well advised not to depend on any particular search_path;
blaming pg_dump for exposing that is just shooting the messenger.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Jeremy Cowgar
Дата:
Сообщение: Re: [BUGS] BUG #14649: Function Namespace Resolution Bug
Следующее
От: nilesoien@gmail.com
Дата:
Сообщение: [BUGS] BUG #14651: Uninitialized page fix corrupted TOAST table