]> granicus.if.org Git - postgresql/commit
Previous fix for temporary file management broke returning a set from
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 29 Dec 2009 17:41:26 +0000 (17:41 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 29 Dec 2009 17:41:26 +0000 (17:41 +0000)
commit31c88772c80cf3863ac538d96187640d41f18884
tree8ad9d7f345744afa05ee5228806e7aed8dfdf4f0
parent6b922abf6024bb0896249d34423c8b70ed9c4f19
Previous fix for temporary file management broke returning a set from
PL/pgSQL function within an exception handler. Make sure we use the right
resource owner when we create the tuplestore to hold returned tuples.

Simplify tuplestore API so that the caller doesn't need to be in the right
memory context when calling tuplestore_put* functions. tuplestore.c
automatically switches to the memory context used when the tuplestore was
created. Tuplesort was already modified like this earlier. This patch also
removes the now useless MemoryContextSwitch calls from callers.

Report by Aleksei on pgsql-bugs on Dec 22 2009. Backpatch to 8.1, like
the previous patch that broke this.
contrib/tablefunc/tablefunc.c
contrib/xml2/xpath.c
src/backend/commands/prepare.c
src/backend/executor/execQual.c
src/backend/executor/tstoreReceiver.c
src/backend/utils/mmgr/portalmem.c
src/backend/utils/sort/tuplestore.c
src/pl/plperl/plperl.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/plpgsql.h