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 1o8nyu-0006py-SL for pgsql-general@arkaria.postgresql.org; Tue, 05 Jul 2022 19:13:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8nyt-0005uA-1i for pgsql-general@arkaria.postgresql.org; Tue, 05 Jul 2022 19:13:07 +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 1o8nys-0005ty-Nd for pgsql-general@lists.postgresql.org; Tue, 05 Jul 2022 19:13:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8nyq-0001CK-J5 for pgsql-general@lists.postgresql.org; Tue, 05 Jul 2022 19:13:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 265JD0OY1997259; Tue, 5 Jul 2022 15:13:00 -0400 From: Tom Lane To: Bryn Llewellyn cc: Adrian Klaver , Pavel Stehule , Christophe Pettus , pgsql-general list Subject: Re: Seems to be impossible to set a NULL search_path In-reply-to: <51E0A66E-C09E-4F6F-8B53-BBB83F810F90@yugabyte.com> 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> Comments: In-reply-to Bryn Llewellyn message dated "Tue, 05 Jul 2022 12:05:01 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1997257.1657048380.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Jul 2022 15:13:00 -0400 Message-ID: <1997258.1657048380@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > Thanks, all, for your replies. I'd assumed that the arguments of "set se= arch_path" had to be SQL names. so I tried "". But that caused an error. I= didn't try the ordinary empty string because I'd assumed that, as an ille= gal SQL name, it would be illegal in "set search_path". Hmm... 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. A bit off topic: I'm not sure how you came to the conclusion that superusers can't write into pg_catalog. They can. But I don't see much point in being paranoid about whether the contents of pg_catalog are trustworthy. If an adversary has already obtained superuser privileges, he needn't bother with anything as complicated as trojan-horsing something you might call later. regards, tom lane