Re: Seems to be impossible to set a NULL search_path

Поиск
Список
Период
Сортировка
От Bryn Llewellyn
Тема Re: Seems to be impossible to set a NULL search_path
Дата
Msg-id 51E0A66E-C09E-4F6F-8B53-BBB83F810F90@yugabyte.com
обсуждение исходный текст
Ответ на Re: Seems to be impossible to set a NULL search_path  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Seems to be impossible to set a NULL search_path  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
adrian.klaver@aklaver.com wrote:

set search_path = '';
show search_path ;
search_path
   -------------
      ""

...But still in this case, there is pg_catalog in search path.

Yes but from OP:

« I've confirmed that even a superuser cannot create objects in a "special" schema like "pg_catalog" or "pg_toast". So this gives me a workaround to the limitation that I cannot force the use of fully qualified names by setting a null search_path: I could set the attribute of my subprogram to "pg_catalog". »

So Bryn Llewellyn does not seem to be concerned about that.

Thanks, all, for your replies. I'd assumed that the arguments of "set search_path" had to be SQL names. so I tried "". But that caused an error. I didn't try the ordinary empty string because I'd assumed that, as an illegal SQL name, it would be illegal in "set search_path". Hmm...

I'm slightly troubled by "works right now":


You use the empty string, rather than NULL... it works right now: 

But because you experts all recommend it, I'll go with it. It's more expressive of what I mean than is using "pg_catalog".

(I'm assuming that having such an unwritable schema inevitably on the search_path is simply an entirely benign benefit. But it could give a strange message to the reader in my use case.)

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

Предыдущее
От: Michael Nolan
Дата:
Сообщение: Re: How to upgrade postgres version 8 to 13
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Seems to be impossible to set a NULL search_path