> ----- Original Message -----
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
> To: "Darko Prenosil" <darko.prenosil@finteh.hr>
> Cc: <pgsql-hackers@postgresql.org>
> Sent: Monday, June 28, 2004 9:39 PM
> Subject: Re: [HACKERS] improper call to spi_printtup ???
>
> > Darko Prenosil <darko.prenosil@finteh.hr> writes:
> > > Anyone knows what I'm doing wrong ?
> >
> > Well, when you didn't show us the text of the function, no.
> >
> > However, a reasonable bet would be that you used SPI inside the function
> > and did not use it correctly, leaving the SPI state corrupted when
> > control got back to plpgsql.
> >
You figure it out right, SPI_finish was in the wrong place.
Thanks again.
Regards !