Re: Fix bug with accessing to temporary tables of other sessions
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Alexander Korotkov <aekorotkov@gmail.com>,
Daniil Davydov <3danissimo@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
Soumya S Murali <soumyamurali.work@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Stepan Neretin <slpmcf@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Mohamed Ali <moali.pg@gmail.com>, Nazneen Jafri <jafrinazneen@gmail.com>,
Shawn McCoy <shawn.the.mccoy@gmail.com>
Date: 2026-05-07T08:43:01Z
Lists: pgsql-hackers
On 07/05/2026 10:04, Alexander Korotkov wrote:
> Thus, I don't see the reason why this shouldn't be committed and
> backpatched to PG17 (first release containing b7b0f3f27241).
Quick question: should we work on a separate patch for PG14-PG16? In
these versions, the error message is raised depending on the temporary
table's tuple count, as demonstrated in [1]:
== session 1 ==
psql (14.20 (Debian 14.20-1.pgdg13+1))
Type "help" for help.
postgres=# CREATE TEMPORARY TABLE t (id int);
CREATE TABLE
postgres=# \d pg_temp*.*
Table "pg_temp_3.t"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
id | integer | | |
== session 2 ==
psql (14.20 (Debian 14.20-1.pgdg13+1))
Type "help" for help.
postgres=# SELECT * FROM pg_temp_3.t;
id
----
(0 rows)
== session 1 ==
postgres=# INSERT INTO t VALUES (42);
INSERT 0 1
== session 2 ==
postgres=# SELECT * FROM pg_temp_3.t;
ERROR: cannot access temporary tables of other sessions
Thanks!
Best, Jim
1 -
https://www.postgresql.org/message-id/800c75af-9bd0-48ac-b4bf-54cadf2bc723%40uni-muenster.de