Re: SPI_ERROR_UNCONNECTED in python callback function - Mailing list pgsql-general

From Tom Lane
Subject Re: SPI_ERROR_UNCONNECTED in python callback function
Date
Msg-id 5613.1244044066@sss.pgh.pa.us
Whole thread Raw
In response to SPI_ERROR_UNCONNECTED in python callback function  (Ian Haywood <ihaywood@iinet.net.au>)
List pgsql-general
Ian Haywood <ihaywood@iinet.net.au> 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

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Upgrading Database: need to dump and restore?
Next
From: Alvaro Herrera
Date:
Subject: Re: lc_messages 8.3.7