Re: [17] Special search_path names "!pg_temp" and "!pg_catalog" - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: [17] Special search_path names "!pg_temp" and "!pg_catalog"
Date
Msg-id 20231026212832.GA1139665@nathanxps13
Whole thread Raw
In response to [17] Special search_path names "!pg_temp" and "!pg_catalog"  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [17] Special search_path names "!pg_temp" and "!pg_catalog"
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Add recovery to pg_control and remove backup_label
Next
From: Tom Lane
Date:
Subject: Re: Does UCS_BASIC have the right CTYPE?