Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qw7uD-009mou-Mx for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Oct 2023 21:28:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qw7uC-005jsm-BD for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Oct 2023 21:28:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qw7uC-005jse-1q for pgsql-hackers@lists.postgresql.org; Thu, 26 Oct 2023 21:28:40 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qw7u8-002zCl-Id for pgsql-hackers@postgresql.org; Thu, 26 Oct 2023 21:28:39 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc04494653so11541195ad.2 for ; Thu, 26 Oct 2023 14:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698355714; x=1698960514; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=uHGdbmX0x3l/nGc+U7uEzqzchdirDeJVE9EEwdoNXKM=; b=YaNekXLqfR2FmL3YY/TVUv9Age0f+iN1u7eKqu9b9/2NzqJT2suRPM3nq+N3a6Dhsm UE+A18LccS+NwJ++hf03gi+/BBkhHTmdihwWKfbsYqCoIFQD34aFMAvKsqMZv2V5UuG3 q+lElsYs5ps0zjJsLOfH/V0Gy4zA2MhvCJhShQi4fk05S2b8urWGg3TW0XVwAzYJ3Cfr ZiBgrBppmSBsgLSaqJgPUIK5bTxf7WjFCcO0LJDNtbciXo8xJ7lJMLp7j0OqUqIJM7LZ 2twoH+/b7Y4FzYdn0nl0VC6sshXR/3p8ifrdRD5NtH/bzo0DbtO/EwB3zkDSEGITaEVp 8/fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698355714; x=1698960514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uHGdbmX0x3l/nGc+U7uEzqzchdirDeJVE9EEwdoNXKM=; b=ey7uaXm7ZLKFiu3iSi7KyDNC6PHOhiAoPC1V2+mE8pOl3ptHruaSvVM6bv7IOT2OK3 9x1zfPDPy+betZU++zZ66UgJQAPysbEZJLTawkXv5GmkGjCX4sVHxLq/J23Jqx+vR9JT as6vjcFM2tc78hjE6ZL00BVMLXi9eR/LcqVk3XCtTs4g/JMs2oPa3lMsn4tUJcjF8euf YHV5n/S505EuJY2zTXvF0K5qyQjm6gqbtNEC0w+QpkJtJqa5CoCv8CYKUE5HEFyvE6BR sZ91dG2Rjd5Qt7unzpqS7dQRY44bnuJcXvZjgjGqhzpPN3eGPhYMn8/u5PhEzyV+Axl6 r3mQ== X-Gm-Message-State: AOJu0Yy0Jh6nYOb2hM73Ic+rpvpDXQm1DVCrugmJU8+192ybN3uM/Ilz u1DIpPmxpqXTpBED7lsFc0Y= X-Google-Smtp-Source: AGHT+IG4R3ZOBs8Z2pFDGudtmDnR8U0IET6zxrCDOQ8tPDdMdBn7p6vwinQG84YsmP3vZEKHrfNCkA== X-Received: by 2002:a17:902:ab4e:b0:1bc:7001:6e62 with SMTP id ij14-20020a170902ab4e00b001bc70016e62mr665789plb.35.1698355714498; Thu, 26 Oct 2023 14:28:34 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id h20-20020a02c4d4000000b00458e239fa31sm32996jaj.55.2023.10.26.14.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 14:28:33 -0700 (PDT) Date: Thu, 26 Oct 2023 16:28:32 -0500 From: Nathan Bossart To: Jeff Davis Cc: pgsql-hackers@postgresql.org Subject: Re: [17] Special search_path names "!pg_temp" and "!pg_catalog" Message-ID: <20231026212832.GA1139665@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Aug 18, 2023 at 02:44:31PM -0700, Jeff Davis wrote: > + SET search_path = admin, "!pg_temp"; I think it's unfortunate that these new identifiers must be quoted. I wonder if we could call these something like "no_pg_temp". *shrug* > + * Add any implicitly-searched namespaces to the list unless the markers > + * "!pg_catalog" or "!pg_temp" are present. Note these go on the front, > + * not the back; also notice that we do not check USAGE permissions for > + * these. > */ > - if (!list_member_oid(oidlist, PG_CATALOG_NAMESPACE)) > + if (implicit_pg_catalog && > + !list_member_oid(oidlist, PG_CATALOG_NAMESPACE)) > oidlist = lcons_oid(PG_CATALOG_NAMESPACE, oidlist); > > - if (OidIsValid(myTempNamespace) && > + if (implicit_pg_temp && > + OidIsValid(myTempNamespace) && > !list_member_oid(oidlist, myTempNamespace)) > oidlist = lcons_oid(myTempNamespace, oidlist); Should we disallow including both !pg_temp and pg_temp at the same time? I worry that could be a source of confusion. IIUC your patches effectively ignore !pg_temp if pg_temp is explicitly listed elsewhere in the list. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com