public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: Christoph Berg <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: ma lz <[email protected]>
Subject: Re: support fix query_id for temp table
Date: Tue, 18 Mar 2025 12:56:42 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <OSZP286MB2253413D25A5D93BEA4F6459F2432@OSZP286MB2253.JPNP286.PROD.OUTLOOK.COM>
<[email protected]>
<[email protected]>
On Mon, Mar 17, 2025 at 10:38:36PM +0100, Christoph Berg wrote:
> Here's that patch with regression tests added. I would think changing
> this would be a big usability improvement for anyone using temp tables
> a lot.
Not the first time I am seeing this argument this month. It is the
second time.
+ /*
+ * If this is a temp table, jumble the name instead of the table oid.
+ */
+ if (expr->rtekind == RTE_RELATION && isAnyTempNamespace(get_rel_namespace(expr->relid)))
+ {
+ rel_name = get_rel_name(expr->relid);
+ AppendJumble(jstate, (const unsigned char *)rel_name, strlen(rel_name));
+ }
+ else
+ JUMBLE_FIELD(relid);
This is OK on its own, still feels a bit incomplete, as the relid also
includes an assumption about the namespace. I would suggested to add
a hardcoded "pg_temp" here, to keep track of this assumption, at
least.
typedef struct RangeTblEntry
{
- pg_node_attr(custom_read_write)
+ pg_node_attr(custom_read_write, custom_query_jumble)
This structure still includes some query_jumble_ignore, which are not
required once custom_query_jumble is added.
We had better document at the top of RangeTblEntry why we are using a
custom function.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, 2-signature.asc)
download
view thread (5+ messages) latest in thread
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], [email protected], [email protected]
Subject: Re: support fix query_id for temp table
In-Reply-To: <[email protected]>
* 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