Brent Verner <brent@rcfile.org> writes:
> | You'll need to make sure that the code isn't expecting to palloc
> | anything first-time-through and re-use it on later loops, but I
> | think that will be okay. (The attribute_buf is the most obvious
> | risk, but that's all right, see stringinfo.c.)
> So I /can't/ palloc some things /before/ switching context to
> per-tuple-context?
Oh, sure you can. That's the point of having a per-query context.
What I was wondering was whether there were any pallocs executed
*after* entering the loop that the code expected to live across
loop cycles. I don't think so, I'm just mentioning the risk as
part of your education ;-)
regards, tom lane