public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nathan Bossart <[email protected]>
To: Jeff Davis <[email protected]>
Cc: [email protected]
Subject: Re: [17] Special search_path names "!pg_temp" and "!pg_catalog"
Date: Thu, 26 Oct 2023 16:28:32 -0500
Message-ID: <20231026212832.GA1139665@nathanxps13> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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






view thread (2+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [17] Special search_path names "!pg_temp" and "!pg_catalog"
  In-Reply-To: <20231026212832.GA1139665@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox