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 1o97BH-0006go-8y for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 15:43:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o97BF-00059V-Ph for pgsql-general@arkaria.postgresql.org; Wed, 06 Jul 2022 15:43:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o97BE-00059M-Qq for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 15:43:09 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o97B6-0008Rf-V8 for pgsql-general@lists.postgresql.org; Wed, 06 Jul 2022 15:43:08 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 861325C007D; Wed, 6 Jul 2022 11:42:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 06 Jul 2022 11:42:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1657122178; x= 1657208578; bh=5L/NB5oah5H6S7rdtJVoEy+JSTSj9pzLvTX5+48a3G8=; b=w B9oFdm60VcyWWWzv7dtk8o94QLZlsiTWIQ7fCk1w329Hi14MSPIj40Cli5PXxQ6f sRP94NyCk1aB7Bi9Fw8pkxGLKyb1NwLTnHIviyZec2cSdEWOxjuvNS6iYghZPAfu cqR0POl8Lf7RxpsJiSyeEn/vgYor/XtNP4CC9VQB6knEPckNoawv/wWKb2fKEDr1 XU40UTpjkt8kMN0ZHBvHJHStQM3fu1Zqhx5WgWDpfdS18go4+UFBN4J7dnGRP0co IUlaQRnRXTOg2qfWEAqTEnP95DOL6tWy/Akz0+dAS1CFkhOn9XwF7OUIcWH5sDyt JyQEomAXdw6TAWm4n3Bfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1657122178; x= 1657208578; bh=5L/NB5oah5H6S7rdtJVoEy+JSTSj9pzLvTX5+48a3G8=; b=P R2xzZfA6lP5EAMHzLYmclzTDMAjgvrq10wsA73U+gJ+8aFsRaioBmAeLl/B3KazL SBflYty/vfiaDU4qIPrjaP4s/G0WK99R96fiI+GaqWzyNsKmc6mdX/NE+jPPj3b7 BttLv17zKFw0TsfuucyO0UW3aWxLBLJJo1KPGDbtbODg8dPo8U84WGAqGfbg838E WjdzKb0ZS5emf6NwR59lCnikAi09sKetuSAkUig1JdYg6BlOmX7eeohJTWucl63B hmfG9Xoy32VdkI9l3vDsk/mlmEcWw+YEQLGW873b3wvXcloJYJinwETtgMkSK5gK tBXrWzRqfVMOmjMi4AZng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeifedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhephffhieegtddvtefgffdvgfeuledtueeghfekvdel vdevjeevveehveffieefueehnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrgh dpshdvrdhtkhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Jul 2022 11:42:56 -0400 (EDT) Message-ID: <7bdd0ecd-0bf6-b5ac-534c-1f2f428c84b7@aklaver.com> Date: Wed, 6 Jul 2022 08:42:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Seems to be impossible to set a NULL search_path Content-Language: en-US To: Bryn Llewellyn , "David G. Johnston" , Tom Lane PostgreSQL Cc: Pavel Stehule , Christophe Pettus , pgsql-general list 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> <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com> From: Adrian Klaver In-Reply-To: <0E972410-9DF5-46B4-ACEA-56B06E5BA96D@yugabyte.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/5/22 20:55, Bryn Llewellyn wrote: > // >> /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 ; Not sure what your point is? > * > 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; > * From here https://www.postgresql.org/docs/current/runtime-config-client.html: search_path (string) ... The value for search_path must be a comma-separated list of schema names ... By quoting the above in either single or double quotes you change what looks like a list pf schemas into a single schema: show search_path; search_path ------------- "s1, s2" If you want that to be a list of schemas then: set search_path = s1, s2; SET show search_path; search_path ------------- s1, s2 > I get a resounding 42 in both cases. Now try this: > > *set search_path = no_such_schema, "No Such Schema";* > *show **search_path;** Which is same as: set search_path = no_such_schema, 'No Such Schema'; show search_path; search_path ---------------------------------- no_such_schema, "No Such Schema" Since the list of names will end up being identifiers for schema any name with spaces needs to be quoted. Otherwise: set search_path = no_such_schema, No Such Schema; ERROR: syntax error at or near "Such" LINE 1: set search_path = no_such_schema, No Such Schema; > * > > All outcomes accord with the mental model that you tell me is wrong. > -- Adrian Klaver adrian.klaver@aklaver.com