Tom Lane wrote:
It's my PL/Java test framework that fails so it's a bit complex but if I'm right, any immutable, set-returning function that allocates stuff in multi_call_memory_context at first call and then reused it, should show the same problem.What life span does the context->multi_call_memory_context have in case of IMMUTABLE functions that returns SETOF?It should be long enough. What's your test case exactly?
I do have a way of logging MemoryContext termination by replacing the function pointer used for context delete with an interceptor that does elog(DEBUG1). I'll see if I can prove that it actually get's deleted between rows. If it does, perhaps I can find the time to write a sample.
Regards, Thomas Hallgren
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend