pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryn Llewellyn <bryn@yugabyte.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Christophe Pettus <xof@thebuild.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Seems to be impossible to set a NULL search_path
Date: Tue, 5 Jul 2022 20:55:59 -0700
Message-ID: <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com> (raw)
In-Reply-To: <CAKFQuwbgvmJBQ2x8HRDHMpVBxt8+UCND0CpbUsfrf9wrWJOEyw@mail.gmail.com>
References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com>
	<0c649c8e-dfff-7dea-908a-7b68611fd18f@aklaver.com>
	<CAFj8pRA2fHFe-zqxnuR27MVGE+waKWsPoDAVD3W3iMj9TTFDjw@mail.gmail.com>
	<593de6cc-08df-bbcb-5164-8796db554851@aklaver.com>
	<51E0A66E-C09E-4F6F-8B53-BBB83F810F90@yugabyte.com>
	<1997258.1657048380@sss.pgh.pa.us>
	<CAKFQuwbgvmJBQ2x8HRDHMpVBxt8+UCND0CpbUsfrf9wrWJOEyw@mail.gmail.com>

> david.g.johnston@gmail.com wrote:
> 
>> tgl@sss.pgh.pa.us wrote:
>> 
>> search_path's value is not a SQL name.  It's a list of SQL names wrapped in a string ... and the list can be empty.
> 
> This doesn't seem to be correct - wrapping them in single quotes in the SET command ends up behaving as if you wrapped them in double quotes anywhere else (and wrapping them individually in double quotes here works just fine too).

And then...

> adrian.klaver@aklaver.com wrote:
> 
> Those are creating objects. Set search_path is setting a configuration value. Pretty sure it is:
> 
> { TO | = } { value | 'value' | DEFAULT 

There's different use cases. For example:

set my_namspace.x = 'Dog house';
show my_namspace.x ;

I can't reconcile what you three (Tom, David, and Adrian) have said. I'm interested to hear how you interpret what I showed in this reply:

https://www.postgresql.org/message-id/48E1391E-5A21-4736-B4B1-8B9468ECAFD4%40yugabyte.com

and in particular to this:

create schema "s1, s2";
create table "s1, s2".t(k int);
insert into "s1, s2".t(k) values(42);
set search_path = "s1, s2";
show search_path;
select k from t;

OR (with single quotes in "set search_path":

create schema "s1, s2";
create table "s1, s2".t(k int);
insert into "s1, s2".t(k) values(42);
set search_path = 's1, s2';
show search_path;
select k from t;

I get a resounding 42 in both cases. Now try this:

set search_path = no_such_schema, "No Such Schema";
show search_path;

All outcomes accord with the mental model that you tell me is wrong.

view thread (31+ messages)  latest in thread

Message-ID: <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com>
Permalink:  ../0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com/
Also on:    postgresql.org/message-id/0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.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: bryn@yugabyte.com, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, pavel.stehule@gmail.com, xof@thebuild.com
  Subject: Re: Seems to be impossible to set a NULL search_path
  In-Reply-To: <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com>
  References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com> <0c649c8e-dfff-7dea-908a-7b68611fd18f@aklaver.com> <CAFj8pRA2fHFe-zqxnuR27MVGE+waKWsPoDAVD3W3iMj9TTFDjw@mail.gmail.com> <593de6cc-08df-bbcb-5164-8796db554851@aklaver.com> <51E0A66E-C09E-4F6F-8B53-BBB83F810F90@yugabyte.com> <1997258.1657048380@sss.pgh.pa.us> <CAKFQuwbgvmJBQ2x8HRDHMpVBxt8+UCND0CpbUsfrf9wrWJOEyw@mail.gmail.com> <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.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