Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8w94-0001Dh-Ia for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 03:56:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8w92-0002Hs-Bb for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 03:56:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8w91-0002Go-Rb for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 03:56:08 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o8w8w-0005IZ-Hd for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 03:56:06 +0000 Received: by mail-pj1-x102b.google.com with SMTP id w24so14073171pjg.5 for ; Tue, 05 Jul 2022 20:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=+PJp3x2Dkmy1RXzjCLfQiZZazRR0T/tL4i7JkGPiPwg=; b=NTFGtlm46sAsqSdnDmzNPiSKyCxsUBdpmG6n4bdo5ZhDS2IqOjIUSuSfwHgfB1iFED NIKhXBEBZ2mfHaKMg7Gm7MsXNOn/UqrVwQloofwF8Hy9/cNRdShmbFrfLXzriwbKocHz BoaLxnVjXXHg3CQ19mZQLIk3azBFF7UXDLPBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=+PJp3x2Dkmy1RXzjCLfQiZZazRR0T/tL4i7JkGPiPwg=; b=pQfragqlVBMcO5QYmxm2aQV9BIpIZi+beAItYISweYWhI112lhBpuZaH1oDcRxCSaa E2Q2SSgIHId4nrYSPPDA2w2yqU87lM5J4T/LZ/6jje0HsCXLsRQ6tdY/ymAZPucJj80Z SCEBcpXdOKpItEeXHM8/6zt7PmDJ44U1a4fRWSZebKZ16F1Oz9KUoNyUcDOKV4LzUBvC OwI+0b1Lrh0vT/og81dfECBfS4i4xGgPppruGYtiorF1hibJ4K8taA7NNs3bZF60wBgI q6HtPlwysJr/YjIxa0JGKaPmClaiZfb3G7PlpWQu5C5Y4BKhZD/6UKxl8Dp2/az4nd0B IntA== X-Gm-Message-State: AJIora/VuJtOy/uI2ZxxyxpCq6WY7nb1vxsC2cSnZud432lj2uvrQ/Q1 pupumS0g1oBRQdbP/AItNLEqMA== X-Google-Smtp-Source: AGRyM1t3TR08nws7Hk6ZF0xvhqNiS9aOI6HRiYJiSQq9x2gaeu+FRrIC9iXC0nZa0031HRqVWH1FCQ== X-Received: by 2002:a17:90b:3e8a:b0:1ef:6a5e:e55a with SMTP id rj10-20020a17090b3e8a00b001ef6a5ee55amr28547963pjb.112.1657079761511; Tue, 05 Jul 2022 20:56:01 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:4575:42ac:10ec:1715]) by smtp.gmail.com with ESMTPSA id j11-20020a170902da8b00b0016bff65d5cbsm462313plx.194.2022.07.05.20.56.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jul 2022 20:56:01 -0700 (PDT) From: Bryn Llewellyn Message-Id: <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_1E125FF2-E38B-498F-A93C-A98AF015C32D" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Seems to be impossible to set a NULL search_path Date: Tue, 5 Jul 2022 20:55:59 -0700 In-Reply-To: Cc: Pavel Stehule , Christophe Pettus , pgsql-general list To: "David G. Johnston" , Tom Lane PostgreSQL , Adrian Klaver References: <4B5F24E6-2FF9-4964-BF07-C609DC38E377@yugabyte.com> <0c649c8e-dfff-7dea-908a-7b68611fd18f@aklaver.com> <593de6cc-08df-bbcb-5164-8796db554851@aklaver.com> <51E0A66E-C09E-4F6F-8B53-BBB83F810F90@yugabyte.com> <1997258.1657048380@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_1E125FF2-E38B-498F-A93C-A98AF015C32D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > david.g.johnston@gmail.com wrote: >=20 >> tgl@sss.pgh.pa.us wrote: >>=20 >> 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. >=20 > 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: >=20 > Those are creating objects. Set search_path is setting a configuration = value. Pretty sure it is: >=20 > { TO | =3D } { value | 'value' | DEFAULT=20 There's different use cases. For example: set my_namspace.x =3D '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 =3D "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 =3D 's1, s2'; show search_path; select k from t; I get a resounding 42 in both cases. Now try this: set search_path =3D no_such_schema, "No Such Schema"; show search_path; All outcomes accord with the mental model that you tell me is wrong. --Apple-Mail=_1E125FF2-E38B-498F-A93C-A98AF015C32D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
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...


Those are creating = objects. Set search_path is setting a configuration value. Pretty = sure it is:

{ TO | =3D } { value | 'value' = | DEFAULT 

There's different use cases. For = example:

set my_namspace.x =3D '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:


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 =3D "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 =3D 's1, s2';
show search_path;
select k from t;

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

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

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

= --Apple-Mail=_1E125FF2-E38B-498F-A93C-A98AF015C32D--