On Tue, Dec 22, 2009 at 11:45 AM, Heikki Linnakangas <heikki.linnakan...@enterprisedb.com> wrote: ... > AFAICS it is always a bug to be in a different memory context > in tuplestore_put* than in tuplestore_begin_heap(), so it would be more > robust to not put the burden on the callers. > ... > Patch against CVS HEAD to do that and fix the reported bug attached. Now > that the tuplestore_put* switches to the right memory context, we could > remove that from all the callers, but this patch only does it for pl_exec.c. > > Thoughts?
I thought there were comments specifically explaining why it was done that way but I don't recall what they said. Perhaps it was a performance concern since it's going to happen for every tuple put in the tuplestore and usually you'll just be in the same memory context anyways. It would certainly be a lot less confusing the way you describe though. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers