Re: [GENERAL] SQL queries inside a C function?

2010-12-26 Thread Pavel Stehule
Hello you can use a SPI interface http://www.postgresql.org/docs/9.0/interactive/spi.html regards Pavel Stehule 2010/12/26 Elliot Chance : > Hi everyone, > > How do I get the active connection handle from inside a C function linked as > a PL/pgSQL function, like: > > Datum pg_do_something(PG_

[GENERAL] SQL queries inside a C function?

2010-12-26 Thread Elliot Chance
Hi everyone, How do I get the active connection handle from inside a C function linked as a PL/pgSQL function, like: Datum pg_do_something(PG_FUNCTION_ARGS) { PGconn *conn = ? // now do some SELECTs / INSERTs PG_RETURN_INT32(result); } Thanks, Elliot -- Sent via pgsql-general mailing