Andres Freund <and...@2ndquadrant.com> writes: > On 2014-04-07 21:47:38 -0400, Tom Lane wrote: >> Well, that is certainly messy. I think you could just use a local >> HeapTupleData variable instead of palloc'ing every time, where "local" >> means "has lifespan similar to the slot pointer".
>> There's some vaguely similar hacking near the end of ExecDelete. > Yea, and some other places. I wonder if a ExecShallowMaterializeSlot() > or something would be useful for me, that callsite and others? Don't like that name much, but I agree there's some room for a function like this. I guess you're imagining that we'd add a HeapTupleData field to TupleTableSlots, and use that for the workspace when this situation arises? An alternative possibility would be to not invent a new function, but just make ExecStoreTuple do this unconditionally when shouldFree=false. Not sure if there'd be a noticeable runtime penalty --- but the existing approach seems rather fragile. I know I've always thought of slots as being fully independent storage, and in this case they are not. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers