public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jim Jones <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: Alexander Korotkov <[email protected]>
Cc: Soumya S Murali <[email protected]>
Cc: Daniil Davydov <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Stepan Neretin <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Mohamed Ali <[email protected]>
Cc: Nazneen Jafri <[email protected]>
Cc: Shawn McCoy <[email protected]>
Subject: Re: Fix bug with accessing to temporary tables of other sessions
Date: Sat, 25 Apr 2026 15:53:41 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CAJDiXghBO_TqvHOSui8MOxiFmwLT20+SAnH5nW1rpWHk7Jwffg@mail.gmail.com>
<[email protected]>
<CAJDiXgi0JFk0f2KWWQkzLBC5P7erX9WP18qqnbi-rjZ-K-P=3w@mail.gmail.com>
<CAMtXxw_hBNuAWQUdSRMpoeRVRYr+5+S7p0bSzuqtHxfpzJPd3w@mail.gmail.com>
<[email protected]>
<CAMtXxw_2VnP5U7U+2ObOCC2voEkAzUqAgH=rPTQBXrb_8K=pyA@mail.gmail.com>
<CAPpHfdtsGSywUExfKMakAuRz8-+61d-4XHkVf=pNQeYTZTVYoA@mail.gmail.com>
<CAMtXxw8J7L0r8aXt9NBFfqqSnaNyU=-_Uq4tW4aO3PHyVeXLAQ@mail.gmail.com>
<CAPpHfdvLCgXgdhSvuPCkek+r=P4E-WiNceWfh7UQztiMzfFcvg@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAKFQuwYy4rEo0xBA9PtxF2=Fkwe0LvnT3yHR+6c5B044d+RPbA@mail.gmail.com>
<[email protected]>
On 25/04/2026 01:01, Jim Jones wrote:
> Until PG16 an error message was raised:
>
> psql (16.13 (Debian 16.13-1.pgdg13+1))
> Type "help" for help.
>
> postgres=# \d pg_temp*.*
> Table "pg_temp_3.t"
> Column | Type | Collation | Nullable | Default
> -----------------+---------+-----------+----------+---------
> generate_series | integer | | |
>
> postgres=# SELECT * FROM pg_temp_3.t;
> ERROR: cannot access temporary tables of other sessions
The PG16 test above was against a non-empty TEMPORARY TABLE. If the
table is empty, the same behaviour from PG17 and PG18 can be observed:
psql (16.13 (Debian 16.13-1.pgdg13+1))
Type "help" for help.
postgres=# \d pg_temp*.*
Table "pg_temp_4.t"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
id | integer | | |
postgres=# SELECT * FROM pg_temp_4.t;
id
----
(0 rows)
The same applies for PG14 and PG15
psql (14.22 (Debian 14.22-1.pgdg13+1))
Type "help" for help.
postgres=# \d pg_temp*.*
Table "pg_temp_3.t"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
id | integer | | |
postgres=# SELECT * FROM pg_temp_3.t;
id
----
(0 rows)
psql (15.17 (Debian 15.17-1.pgdg13+1))
Type "help" for help.
postgres=# \d pg_temp*.*
Table "pg_temp_3.t"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
id | integer | | |
postgres=# SELECT * FROM pg_temp_3.t;
id
----
(0 rows)
Since the table is indeed empty, the result is actually correct. But I'd
argue that we should raise an ERROR even if the table is empty. IMHO,
getting an error message or a "0 rows" result depending on the table row
count isn't ideal.
After populating the TEMPORARY TABLE the expected error message appears:
ERROR: cannot access temporary tables of other sessions
Best, Jim
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], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Fix bug with accessing to temporary tables of other sessions
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