Thread: pgsql: Fix aboriginal mistake in plpython's set-returning-function supp
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. Branch ------ REL8_4_STABLE Details ------- http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=7508d9d87e7d506b3e56ba3e0a778efa33a17912 Modified Files -------------- src/pl/plpython/expected/plpython_function.out | 8 ++++++ src/pl/plpython/expected/plpython_test.out | 9 +++++++ src/pl/plpython/plpython.c | 28 +++++++++++++++++------ src/pl/plpython/sql/plpython_function.sql | 9 +++++++ src/pl/plpython/sql/plpython_test.sql | 2 + 5 files changed, 48 insertions(+), 8 deletions(-)