> - Original Message -
> From: "Tom Lane" <[EMAIL PROTECTED]>
> To: "Darko Prenosil" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, June 28, 2004 9:39 PM
> Subject: Re: [HACKERS] improper call to spi_printtup ???
>
sprintf(values[12],"%c",inf->result->tupdesc->attrs[call_cntr]->attalign);
sprintf(values[13],"%i",inf->result->tupdesc->attrs[call_cntr]->attnotnull);
sprintf(values[14],"%i",inf->result->tupdesc->attrs[call_cntr]->atthasdef);
Darko Prenosil <[EMAIL PROTECTED]> 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
I have set returning function written in 'c', declared as:
CREATE OR REPLACE FUNCTION check_view (text,text) RETURNS setof pg_attribute
AS '/usr/local/pgsql/lib/libplpq.so','check_view' LANGUAGE 'c'
WITH (isstrict);
When I call this function from psql :
SELECT attrelid,attnum FROM che