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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to