SQL queries inside a C function?

From: Elliot Chance <elliotchance(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL queries inside a C function?
Date: 2010-12-26 13:07:24
Message-ID: 5B2EF0D2-4B24-43D4-8BCD-96DE53D98AB8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-12-26 13:24:33 Re: SQL queries inside a C function?
Previous Message sunpeng 2010-12-26 12:35:25 why update is slower on my pc?