Re: SPI_ERROR_UNCONNECTED in python callback function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ian Haywood <ihaywood(at)iinet(dot)net(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SPI_ERROR_UNCONNECTED in python callback function
Date: 2009-06-03 15:47:46
Message-ID: 5613.1244044066@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ian Haywood <ihaywood(at)iinet(dot)net(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Kohll - Mailing Lists 2009-06-03 15:48:15 Division by zero
Previous Message Bill Moran 2009-06-03 15:45:44 Re: Upgrading Database: need to dump and restore?