public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Jones <[email protected]>
To: Daniil Davydov <[email protected]>
Cc: Soumya S Murali <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Stepan Neretin <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Fix bug with accessing to temporary tables of other sessions
Date: Thu, 9 Apr 2026 19:46:02 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJDiXghBO_TqvHOSui8MOxiFmwLT20+SAnH5nW1rpWHk7Jwffg@mail.gmail.com>
References: <CAJDiXghdFcZ8=nh4G69te7iRr3Q0uFyXxb3ZdG09_GTNZXwH0g@mail.gmail.com>
	<CAJDiXgj5rFYxuLYSpQxidQ+1cZ=6rJx29MvV+RAjKX7B=EGUvw@mail.gmail.com>
	<CAJDiXggOEN06RwBBCJ-egzkmTbm81=LJ5eCNmvzr=Bpwnp5VzA@mail.gmail.com>
	<CAJDiXgi7tWm_y0i7kD8fMxGe=86_W-hMxyQS+g7-7cdTzd-KRQ@mail.gmail.com>
	<CAMtXxw_ta_9i=uPJMvGueOBc04crmraJXcyJhN0K=Wu9aa2rog@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAJDiXgh9g4TEyF3kWCiBgHX6QbpATZtxTfrQuBCKxUO5=nZBOw@mail.gmail.com>
	<[email protected]>
	<CAJDiXgihovkP6DMAFyJtYF4JSAjvKmiRVbF5R5n3SA=Yag32_w@mail.gmail.com>
	<CAMtXxw8pHLH9+mG3wxsF8f=Y+pHqTNP8X1UmZQPkRL9pZ5aF2w@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAJDiXgiAObr4c+PTWSS19vcohrFSDLK3MC5FK3TekMB3U3DjfQ@mail.gmail.com>
	<[email protected]>
	<CAJDiXghBO_TqvHOSui8MOxiFmwLT20+SAnH5nW1rpWHk7Jwffg@mail.gmail.com>



On 09/04/2026 17:29, Daniil Davydov wrote:
> On Thu, Apr 9, 2026 at 9:35 PM Jim Jones <[email protected]> wrote:
> Hm. I see that read_stream_begin_relation immediately calls
> read_stream_begin_impl, where we have a "rel != NULL" check (read_stream.c:787).
> Anyway, I think that we shouldn't rely on the fact that a given Relation will
> always be valid. Please, correct me if I am wrong.
> 
> I see that you don't really like the idea of moving this check. But since a
> vectored variant of ReadBuffer() may be used by anyone, don't we need to take
> it into account?
>> Also, wouldn't it potentially make this check multiple times in a table
>> scan?
> Yep, it will. It is exactly the same logic as for ReadBuffer_common,
> PrefetchBuffer and ReadBufferExtended (i.e. checking this constraint before
> each buffer read). I don't see anything wrong with this approach. More
> precisely, it would be good to avoid multiple checks, but I don't see a way to
> do that.

This check exists because read_stream_begin_smgr_relation() passes NULL,
but I see your point. I guess a check in read_stream_begin_relation()
and in StartReadBuffersImpl() would be the best solution? If you agree,
could you add it in v16?

Thanks!

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]
  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