Re: how to get the connected session pointer ( Archive * AH)

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: how to get the connected session pointer ( Archive * AH)
Дата
Msg-id 5266CB1E.5000902@hogranch.com
обсуждение исходный текст
Ответ на Re: how to get the connected session pointer ( Archive * AH)  (AI Rumman <rummandba@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Monitoring number of backends
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Monitoring number of backends