Re: support fix query_id for temp table

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: ma lz <ma100(at)hotmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: support fix query_id for temp table
Date: 2024-02-01 08:46:36
Message-ID: ZbtabEYMaZ3-wcxv@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 01, 2024 at 07:37:32AM +0000, ma lz wrote:
> session 1:
> create temp table ttt ( a int );
> insert into ttt values(3); -- query_id is XXX from pg_stat_activity
>
> session 2:
> create temp table ttt ( a int );
> insert into ttt values(3); -- query_id is YYY from pg_stat_activity
>
> I know temp table has different oid, so query_id is different, is
> there a way to use table name for temp table instead of oid?

The CREATE TABLE statements have indeed the same query ID (in 16~),
and the inserts have a different one as they touch different schemas
and relations. That's quite an old problem, that depends on the
RangeVar attached to an InsertStmt. I don't quite see a way to
directly handle that except by using a custom implementation in query
jumbling for this node and its RangeVar, so there is no "easy" way to
tackle that :/
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marius Lorek 2024-02-01 09:22:35 TableOID in description of inlined function
Previous Message ma lz 2024-02-01 07:37:32 support fix query_id for temp table