> On Nov 4, 2026, at 23:26, Jim Jones <[email protected]> wrote:
>
> On 04/11/2026 14:37, Fujii Masao wrote:
>> Yeah, since AFAICT there seems no need to invoke registered callbacks,
>> ResetExprContext() might be sufficient. Also, ResetPerTupleExprContext()
>> would be better for consistency with CopyFrom(), which uses it?
>>
>
>
> IIUC es_per_tuple_exprcontext will always be non-NULL because of
> GetPerTupleExprContext(), so in theory the extra check in
> ResetPerTupleExprContext() is a bit redundant, but I agree it's a good
> idea to keep the code consistent.
>
> Thanks!
>
> Best, Jim
>
CopyFrom() does this combination:
```
ResetPerTupleExprContext(estate);
MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
```
So, if we use ResetPerTupleExprContext(estate), then
MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory); should be changed
accordingly. I think Ayoub commented the same thing.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/