Hi, On Sat, Jun 20, 2026 at 10:48 PM ZizhuanLiu X-MAN <[email protected]> wrote: > > Just as described in the comment of RELATION_IS_OTHER_TEMP macro in rel.h, > existing buffer manager routines including ReadBuffer_common(), > StartReadBuffersImpl() > and PrefetchBuffer() have already invoked this macro to check cross-session > temporary > table access. All these functions are located in bufmgr.c. > > For code consistency, I suggest adding the same RELATION_IS_OTHER_TEMP check > in > ExtendBufferedRelCommon() (also in bufmgr.c), right before calling > ExtendBufferedRelLocal().
Thank you for your feedback! Do you mean that this check should be moved to "ExtendBufferedRelCommon" because this function is in the bufmgr.c file? If so, I don't see the point in that. Buffer manager is not only the bufmgr.c file, but also all the files in the "storage/buffer" folder. So we can say that localbuf.c also contains logic related to the buffer manager. Moreover, ExtendBufferedRelCommon should contain only the logic that is really common for both ordinary and temp tables. All other specific code is encapsulated inside the ExtendBufferedRelLocal and ExtendBufferedRelShared. It allows us to keep the ExtendBufferedRelCommon function pretty short. So, I suggest leaving RELATION_IS_OTHER_TEMP as it is. > Meanwhile, we should also update the comment of RELATION_IS_OTHER_TEMP > accordingly to keep the documentation synchronized with code changes. This comment is already updated - it now mentions the ExtendBufferedRelLocal function. -- Best regards, Daniil Davydov
