Re: Detecting backend failures via libpq / DBD::Pg

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Detecting backend failures via libpq / DBD::Pg
Дата
Msg-id 54A20641.5020706@BlueTreble.com
обсуждение исходный текст
Ответ на Detecting backend failures via libpq / DBD::Pg  ("Greg Sabino Mullane" <greg@turnstep.com>)
Список pgsql-hackers
On 12/29/14, 6:43 PM, Greg Sabino Mullane wrote:
> I am working on enhancing the ping() method of DBD::Pg. The goal of that
> is for a user to be able to determine if the connection to the database
> is still valid.

This is actually a VERY common thing for monitoring frameworks to do. Currently, the general method seems to be
somethingakin to
 

psql -c 'SELECT 1' ...

perhaps instead of going through all the effort that you currently are we could add a FEBE ping command, and expose
thatthrough a special psql option (or maybe a special pg_ping command).
 

This won't be noticeably faster than SELECT 1, but it would prevent a bunch of pointless work on the backend side, and
shouldgreatly simplify DBD's ping(). Only thing I'm not sure of is if this could be made to be safe within a COPY...
:(
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: nls and server log
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: Additional role attributes && superuser review