Re: Fix bug with accessing to temporary tables of other sessions
Soumya S Murali <soumyamurali.work@gmail.com>
From: Soumya S Murali <soumyamurali.work@gmail.com>
To: Daniil Davydov <3danissimo@gmail.com>
Cc: Jim Jones <jim.jones@uni-muenster.de>, Stepan Neretin <slpmcf@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-23T10:22:36Z
Lists: pgsql-hackers
Hi all, Thank you for the updated patches. On Mon, Mar 23, 2026 at 12:56 PM Daniil Davydov <3danissimo@gmail.com> wrote: > > Hi, > > Posting rebased set of patches. I have gone through the patches and tested the patch series. I successfully reproduced the bug before applying the patch and found that the cross-session SELECT via schema-qualified temp table did not raise an error; instead, it returned an empty result, indicating inconsistent behaviour. After applying the patch, regression tests passed successfully and new regression tests behave as expected. Temporary tables from other sessions are now no longer visible and all the attempts to access them result in error. Also I verified:- Schema-qualified SELECT, INSERT / UPDATE / DELETE, JOIN queries, Subqueries and EXPLAIN worked as expected. Same-session access also works as expected. Overall the patch LGTM. Regards, Soumya
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Prevent access to other sessions' temp tables
- 4dfae59a1d31 17 (unreleased) landed
- 1b0dd08157bf 18 (unreleased) landed
- ce146621f786 19 (unreleased) landed
-
Add tests for cross-session temp table access
- 40927d458fe1 17 (unreleased) landed
- 1cd37a7a8dc6 18 (unreleased) landed
- 1fee0e857e33 19 (unreleased) landed
-
Doc: use "an SQL" consistently rather than "a SQL"
- b51f86e49a7f 18.0 cited
-
Modify the relcache to record the temp status of both local and nonlocal
- 948d6ec90fd3 8.4.0 cited