"Euler Taveira" <euler@eulerto.com> writes:
> On Sat, Oct 4, 2025, at 11:29 PM, PG Bug reporting form wrote:
>> If plan is canSetTag subqueries, `SPI_freetuptable(my_tuptable)` is
>> meaningless, because `my_tuptable` is NULL.
> There could be multiple statements. The first case will call SPI_freetuptable()
> and it is a noop. The code path you are referring to is inside a foreach loop
> and a previous statement might set my_tuptable and needs to be freed before
> reusing it. That's exactly what the comment says.
Yeah. You'd only reach this case if there were multiple SQL
statements in the string given to SPI_execute() or similar,
but that's perfectly legal.
regards, tom lane