Re: how to get the connected session pointer ( Archive * AH) - Mailing list pgsql-general

From John R Pierce
Subject Re: how to get the connected session pointer ( Archive * AH)
Date
Msg-id 5266CB1E.5000902@hogranch.com
Whole thread Raw
In response to Re: how to get the connected session pointer ( Archive * AH)  (AI Rumman <rummandba@gmail.com>)
List pgsql-general
On 10/22/2013 9:27 AM, AI Rumman wrote:
> I have a libpq C interface code which takes user/password to connect
> to the db. Now, I want to call it from a pgsql function where user
> will not need to put any user name or password, rather it will use the
> current session ID.
> How can I do it? Any idea, please.


you shouldn't be calling libpq from within a postgres C function at all.

if you want to make queries on the same database, use the SPI interface,
see http://www.postgresql.org/docs/current/static/spi.html

If you want to connect to another database, use postgres_fdw

--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Monitoring number of backends
Next
From: John R Pierce
Date:
Subject: Re: Monitoring number of backends