Re: Seems to be impossible to set a NULL search_path

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Seems to be impossible to set a NULL search_path
Date: 2022-07-06 21:10:35
Message-ID: 8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/6/22 14:47, Bryn Llewellyn wrote:
> The problem was my stupid typo: writing « set search_path =
> 'pg_catalog, pg_temp'; » when I should *not* have typed those single
> quotes. Now the demo that I'd intended gets the outcome that I'd expected:
>
> *select count(*) from pg_class; --------------<< 399
> create temporary table pg_class(k int);
> select count(*) from pg_class; --------------<<   0
> set search_path = pg_catalog, pg_temp;
> select count(*) from pg_class; --------------<< 400
> *
There's no surprise here.  you read the system catalogue, made a table
in whatever is the current schema which hid system's table, then hid
your table by the new path.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2022-07-06 22:15:39 Re: Seems to be impossible to set a NULL search_path
Previous Message Bryn Llewellyn 2022-07-06 20:47:03 Re: Seems to be impossible to set a NULL search_path