Ian Haywood <ihaywood@xxxxxxxxxxxx> writes: > It seems as soon as execution leaves the main function access to SPI is lost. Is this correct or a bug? What this probably means is that plpython is failing to use SPI_push/SPI_pop properly --- these should be called around any operation that might invoke an independent SPI-using function: http://www.postgresql.org/docs/8.3/static/spi-spi-push.html I'm not enough of a plpython user to be excited about trying to fix it, but if you are then please send a patch. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general