Re: Skip temporary table schema name from explain-verbose output.

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amul Sul <sulamul(at)gmail(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Skip temporary table schema name from explain-verbose output.
Date: 2021-07-26 17:53:51
Message-ID: 202107261753.xma3mhuauosa@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-07-26 18:04:35 Re: Fix around conn_duration in pgbench
Previous Message 蔡梦娟 (玊于) 2021-07-26 17:38:58 Why don't update minimum recovery point in xact_redo_abort