pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Seems to be impossible to set a NULL search_path
Date: Wed, 6 Jul 2022 15:10:35 -0600
Message-ID: <8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com> (raw)
In-Reply-To: <AFB4365D-8533-4784-A81F-CD92B506306E@yugabyte.com>
References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com>
	<CAKFQuwa4nF2RwO4O=nhUYHE_PSkQpsetyGwy0LF1EBjWr554WQ@mail.gmail.com>
	<CEF1B8C3-6D41-4F31-9D05-AD280809D99B@yugabyte.com>
	<CAKFQuwZF-Jj1vpT-0xdWXi4y2oXqu7G0MK26im9DKAnS=finxQ@mail.gmail.com>
	<AFB4365D-8533-4784-A81F-CD92B506306E@yugabyte.com>

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.

view thread (31+ messages)  latest in thread

Message-ID: <8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com>
Permalink:  ../8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com/
Also on:    postgresql.org/message-id/8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: Seems to be impossible to set a NULL search_path
  In-Reply-To: <8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com>
  References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com> <CAKFQuwa4nF2RwO4O=nhUYHE_PSkQpsetyGwy0LF1EBjWr554WQ@mail.gmail.com> <CEF1B8C3-6D41-4F31-9D05-AD280809D99B@yugabyte.com> <CAKFQuwZF-Jj1vpT-0xdWXi4y2oXqu7G0MK26im9DKAnS=finxQ@mail.gmail.com> <AFB4365D-8533-4784-A81F-CD92B506306E@yugabyte.com> <8029d17a-edc0-2cc8-0ea5-a7e18791bc0d@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox