]> granicus.if.org Git - postgresql/commit
Fix aboriginal mistake in plpython's set-returning-function support.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Nov 2010 19:27:12 +0000 (14:27 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Nov 2010 19:27:12 +0000 (14:27 -0500)
commit0c6c5b8a2d94c3ee74e7bba5eedcaae64471e463
tree5602d2456a36ef08a9234f87ee0a1e9e455bc536
parente642ca767c72f1c71aabb1ca08c838df3a6cff51
Fix aboriginal mistake in plpython's set-returning-function support.

We must stay in the function's SPI context until done calling the iterator
that returns the set result.  Otherwise, any attempt to invoke SPI features
in the python code called by the iterator will malfunction.  Diagnosis and
patch by Jan Urbanski, per bug report from Jean-Baptiste Quenot.

Back-patch to 8.2; there was no support for SRFs in previous versions of
plpython.
src/pl/plpython/expected/plpython_function.out
src/pl/plpython/expected/plpython_test.out
src/pl/plpython/plpython.c
src/pl/plpython/sql/plpython_function.sql
src/pl/plpython/sql/plpython_test.sql