Re: [PATCH] Connection time for \conninfo

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Connection time for \conninfo
Дата
Msg-id 20190904030604.GA2170@paquier.xyz
обсуждение исходный текст
Ответ на [PATCH] Connection time for \conninfo  (Rodrigo Ramírez Norambuena <decipher.hk@gmail.com>)
Ответы Re: [PATCH] Connection time for \conninfo  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: [PATCH] Connection time for \conninfo  (Rodrigo Ramírez Norambuena <decipher.hk@gmail.com>)
Список pgsql-hackers
On Tue, Sep 03, 2019 at 10:13:57PM -0400, Rodrigo Ramírez Norambuena wrote:
> I've work in the a little patch to add into the \conninfo of psql
> command the connection time  against a server backend
>
> Maybe could add after, the precheck to if the connection is alive.
> I've take first look to the pqPacketSend, my idea is send a ECHO
> packet over to the database connection. If someone has a better idea
> it would be great to know.

You can do basically the same thing by looking at
pg_stat_activity.backend_start and compare it with the clock
timestamp.  Doing it at SQL level the way you want has also the
advantage to offer you a modular format output.
--
Michael

Вложения

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

Предыдущее
От: Rodrigo Ramírez Norambuena
Дата:
Сообщение: [PATCH] Connection time for \conninfo
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Transactions involving multiple postgres foreignservers, take 2