Re: pl/pgsql, cursors and C function - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: pl/pgsql, cursors and C function
Date
Msg-id 3F707820.1000100@klaster.net
Whole thread Raw
In response to Re: pl/pgsql, cursors and C function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pl/pgsql, cursors and C function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
>>I don't understand ERROR message at all:
>>  ERROR:  SPI_prepare() failed on "SELECT   $1 "
> 
> 

>  > This is a bug.  Or two bugs, actually: one of yours and one of PG's.
> I have repaired the PG bug with the attached patch.  The bug in your
> code is that your C function needs to call SPI_connect and SPI_finish
> if it's going to use any SPI operations.
> 
>             regards, tom lane

Thanks a lot. The first answer helped me, the second one - the others.

Do you know anything about good source of C functions documentation and 
examples? Currently I'm walking over .h headers to find some useful 
functions and macros.


Regads,
Tomasz Myrta



pgsql-sql by date:

Previous
From: Jeff Kowalczyk
Date:
Subject: updating a field with a SUM from another table
Next
From: "scott.marlowe"
Date:
Subject: Re: Using sql statements in file