Re: [GENERAL] SPI_ERROR_UNCONNECTED in python callback function

2009-06-03 Thread Tom Lane
Ian Haywood 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 S

[GENERAL] SPI_ERROR_UNCONNECTED in python callback function

2009-06-03 Thread Ian Haywood
I am using PL/Python to make queries via SPI. This seems to work when the query is made directly, but when I pass a function as a callback to an external module (in this case, python's cheetah templating engine), the function fails thusly: =# select common.template(8963,1); ERROR: plpython: fu