Re: Clients disconnect but query still runs

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Clients disconnect but query still runs
Дата
Msg-id 20090806170642.GW5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Clients disconnect but query still runs  (Nicolas <nicolas.marchildon@gmail.com>)
Список pgsql-general
On Thu, Aug 06, 2009 at 07:23:41AM -0700, Nicolas wrote:
> Now, I'm in a situation where I have many "IDLE in transaction". I
> spotted them myself. I could kill them, but that wouldn't prevent them
> from happening again. In fact, it happens regularily.
>
> Is there a way to get the list of SQL statements that were previously
> executed as part of a given transaction?

I'd play with logging and setting your "log_line_prefix"[1] to include
the process id and "log_statement" to "all".  It's then a simple matter
of searching back through the logs to find out what was going on.

--
  Sam  http://samason.me.uk/

 [1] http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-LINE-PREFIX
 [2] http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-STATEMENT

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

Предыдущее
От: Josh Trutwin
Дата:
Сообщение: Empty Updates, ON UPDATE triggers and Rules
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Empty Updates, ON UPDATE triggers and Rules