Re: connection watchdog

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: connection watchdog
Дата
Msg-id 3DA5E179.1343.527B6FC@localhost
обсуждение исходный текст
Ответ на connection watchdog  (Michael Kichanov <mike@nordlink.ru>)
Ответы Re: connection watchdog
Список pgsql-general
On 10 Oct 2002 at 18:45, Michael Kichanov wrote:

> Hi Postgres gurus!
>
> How can I check from C-program whether connection to pgsql
> engine still works or already lost?
> PQstatus() returns CONNECTION_OK even when backend process is killed
> by hands after connection is made.

There is a function which returns fd of the connection to postgresql database.
If you install a SIGPIPE handler on that connections, perhaps you can catch the
signal that backend is killed. But you will get that signal only when you
attempt to write to the  fd, according to 'man 7 signal' on my mandrake box.

Just theory. Try it out and let us know if it works..

HTH


Bye
 Shridhar

--
Preudhomme's Law of Window Cleaning:    It's on the other side.


В списке pgsql-general по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: encryption
Следующее
От: "Roberto (SmartBit)"
Дата:
Сообщение: Re: Getting tables, procedures, etc.