Re: SQL queries inside a C function?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Elliot Chance <elliotchance(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL queries inside a C function?
Date: 2010-12-26 13:24:33
Message-ID: AANLkTimDhthXBBQ=9ehB1D0RXcQQSaEQ9xybHJmTM+DX@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 <elliotchance(at)gmail(dot)com>:
> 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 list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Satoshi Nagayasu 2010-12-26 14:57:05 Re: why update is slower on my pc?
Previous Message Elliot Chance 2010-12-26 13:07:24 SQL queries inside a C function?