Perhaps someone can explain what's wrong with this.  Excuse the mess,
it was cut out of a much larger function but reliably creates the
error on my Postgres 7.1 beta 4 machine.

Compile C function, restart postgres (for the heck of it), create a
new db (I used 'stuff), import sql.  The insert it runs at the end
fails, and:

pqReadData() -- backend closed the channel unexpectedly.....

Quite confused, if I remove the SPI_Finish() it works fine, but
complains every time an SPI_Connect is issued after the first run of
the function.

As you can see, the closure is SPI_Finish as the notice before
appears, and the notice after doesn't.

--
Rod Taylor

There are always four sides to every story: your side, their side, the
truth, and what really happened.
Fri, 16 Feb 2001 16:08:09 -0500
"Rod Taylor" <rod.taylor@inquent.com>
SPI_Free() causes backend to close.