Peter Geoghegan <pg@bowt.ie> writes:
> On Mon, Apr 16, 2018 at 1:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> BTW, I notice that in this situation, readtup_heap seems to be
>> palloc'ing in the caller's context, but it counts the memory as
>> if it were in the tuplestore's context. Somebody's confused there.
> I could just kick myself for not going through tuplestore (and its
> version of readtup_heap) as part of the 90decdba3 work.
Yeah, I should have thought to question that too. tuplestore was
originally built by stripping down tuplesort, and at least in the
beginning, I'm pretty sure that all these semantic API details were
the same. We should likely have made more effort to keep them in
sync. (Still, until we've proven that there *is* a bug here,
let's not kick ourselves too hard.)
regards, tom lane