"Michael Andreen" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION crash() > RETURNS int4 AS > $BODY$$rv = spi_exec_query("SELECT 1"); > $query = spi_prepare('SELECT 1 WHERE 1 = $1','integer'); > return 1;$BODY$ > LANGUAGE 'plperl' VOLATILE;
Thanks for the test case. This is not plperl's fault, it's the consequence of some anti-memory-leak code added very recently. Here's the fix if you need it right away... regards, tom lane *** src/backend/executor/spi.c.orig Tue Nov 21 17:35:29 2006 --- src/backend/executor/spi.c Thu Dec 7 19:33:33 2006 *************** *** 1543,1548 **** --- 1543,1551 ---- SPI_lastoid = my_lastoid; SPI_tuptable = my_tuptable; + /* tuptable now is caller's responsibility, not SPI's */ + _SPI_current->tuptable = NULL; + return my_res; } *************** *** 1694,1699 **** --- 1697,1705 ---- /* Put the result into place for access by caller */ SPI_processed = _SPI_current->processed; SPI_tuptable = _SPI_current->tuptable; + + /* tuptable now is caller's responsibility, not SPI's */ + _SPI_current->tuptable = NULL; /* Pop the SPI stack */ _SPI_end_call(true); ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings