Re: Skip temporary table schema name from explain-verbose output. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Skip temporary table schema name from explain-verbose output.
Date
Msg-id 202107261753.xma3mhuauosa@alvherre.pgsql
Whole thread Raw
In response to Re: Skip temporary table schema name from explain-verbose output.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Skip temporary table schema name from explain-verbose output.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2021-Jul-26, Tom Lane wrote:

> On the other hand, I don't like 0002 one bit, because it's not accounting
> for whether the temp schema it's mangling is *our own* temp schema or some
> other session's.  I do not think it is wise or even safe to report some
> other temp schema as being "pg_temp".  By the same token, I wonder whether
> this bit in event_trigger.c is a good idea or a safety hazard:
> 
>                             /* XXX not quite get_namespace_name_or_temp */
>                             if (isAnyTempNamespace(schema_oid))
>                                 schema = pstrdup("pg_temp");
>                             else
>                                 schema = get_namespace_name(schema_oid);

Oh, you meant this one.  To be honest I don't remember *why* this code
wants to show remote temp tables as just "pg_temp" ... it's possible
that some test in the DDL-to-JSON code depended on this behavior.
Without spending too much time analyzing it, I agree that it seems
dangerous and might lead to referring to unintended objects.  (Really,
my memory is not clear on *why* we would be referring to temp tables of
other sessions.)

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"No necesitamos banderas
 No reconocemos fronteras"                  (Jorge González)



pgsql-hackers by date:

Previous
From: "蔡梦娟(玊于)"
Date:
Subject: Why don't update minimum recovery point in xact_redo_abort
Next
From: Fujii Masao
Date:
Subject: Re: Fix around conn_duration in pgbench