Re: Another thought about search_path semantics

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Another thought about search_path semantics
Дата
Msg-id 22639.1396636366@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Another thought about search_path semantics  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: Another thought about search_path semantics  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> I was thinking - but not saying explicitly - of rigging things so that
> pg_catalog is ignored when searching for the target schema for object
> creation unless explicitly specified. So if there's no other schema in
> the search path you'd get the error about no "no schema has been
> selected to create in", even if pg_catalog is somewhere in there.

Hm.  Seems pretty grotty, but it'd at least fix pg_dump's problem,
since pg_dump's lists are always "foo, pg_catalog" with no third
schema mentioned.  I think what we'd actually need is to say
"pg_catalog cannot be selected as the creation target unless it's
the *first* entry in the search_path list".

The larger issue here is that if search_path is say "a, b, c" and
"a" doesn't exist, is it really sane to create in "b" instead?

Another relatively narrow fix we could consider is to revert to
treating "$user" specially, such that it can be skipped over if
nonexistent for the purpose of selecting a creation target, but
actual schema names cannot be.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Another thought about search_path semantics
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Another thought about search_path semantics