Re: display previous query string of idle-in-transaction

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: display previous query string of idle-in-transaction
Дата
Msg-id 4A69831A0200002500028D0D@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: display previous query string of idle-in-transaction  (daveg <daveg@sonic.net>)
Ответы Re: display previous query string of idle-in-transaction  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
daveg <daveg@sonic.net> wrote:
> On Thu, Jun 04, 2009 at 10:22:41PM -0400, Robert Haas wrote:
>> maybe make a separate column called "idle" that's a boolean,
>> or something, and let the query column contain the most recent
>> query (whether or not it's still executing).
+1
> I like this idea a lot. Possibly it would be useful to have the end
> time of the last query too, then one could find idle sessions that
> were old and truly idle rather than just waiting for a busy client
> to send the next query.
> 
>    select ... from pg_stat_activity
>      where idle
>        and last_statement_endtime < now() - interval '1 minute';
+1
Of course, you might be more interested in those which are idle in a
transaction, but that's easily done with these changes -- just throw
in xact_start IS NULL.
-Kevin


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: join regression failure on cygwin
Следующее
От: Robert Haas
Дата:
Сообщение: Re: display previous query string of idle-in-transaction