Re: Clients disconnect but query still runs - Mailing list pgsql-general

From Sam Mason
Subject Re: Clients disconnect but query still runs
Date
Msg-id 20090806170642.GW5407@samason.me.uk
Whole thread Raw
In response to Re: Clients disconnect but query still runs  (Nicolas <nicolas.marchildon@gmail.com>)
List 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 by date:

Previous
From: Josh Trutwin
Date:
Subject: Empty Updates, ON UPDATE triggers and Rules
Next
From: Merlin Moncure
Date:
Subject: Re: Empty Updates, ON UPDATE triggers and Rules