Re: Fix bug with accessing to temporary tables of other sessions

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: Soumya S Murali <soumyamurali(dot)work(at)gmail(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stepan Neretin <slpmcf(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix bug with accessing to temporary tables of other sessions
Date: 2026-04-13 14:18:07
Message-ID: CAJDiXgi13j8KoK_19Wy_pW=hB_-KmtFUnkzUG++NFxkxXDxkEg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Apr 13, 2026 at 7:39 PM Soumya S Murali
<soumyamurali(dot)work(at)gmail(dot)com> wrote:
>
>
> I tested the v16 patch on a clean tree and verified the behavior
> across multiple execution paths.

Thanks!

> Cross-session access is consistently
> blocked; all attempts result in an error - "relation does not exist"

Hm, our patch should give an error like "cannot access temporary relations of
other sessions". If you see "relation does not exist" I guess you try to access
other session's temp table only by its name. It will not work since postgres
will search this name within the "pg_temp" schema of the current session. You
should explicitly specify other session's temp schema name in order to access
its temp tables. You can find examples in our new test.

Please, let me know if I am wrong and the current patch actually allows
"relation does not exist" error to occur. In this case, it should be fixed.

--
Best regards,
Daniil Davydov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2026-04-13 14:34:15 Re: Heads Up: cirrus-ci is shutting down June 1st
Previous Message Andres Freund 2026-04-13 14:08:16 Re: test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)