Re: Very long " in transaction" query - Mailing list pgsql-admin

From Jan Lentfer
Subject Re: Very long " in transaction" query
Date
Msg-id a96af08dc91e765a4cd37191a092ca64@neslonek.homeunix.org
Whole thread Raw
In response to Very long " in transaction" query  ("Gnanakumar" <gnanam@zoniac.com>)
List pgsql-admin
On Thu, 3 May 2012 15:48:35 +0530, Gnanakumar wrote:
> Hi,
>
> Recently, in our Production server, we found a "single query" being
> held up
> in "<IDLE> in transaction" for more than 19 hours using the following
> query:

[...]

Usually these are application problems, not database ones. E.g. a piece
of code not cathing an error correctly or breaking out of a loop or
something like that and leaving the transaction open (not issuing COMMIT
or ROLLBACK). Seens this quite often in production and it was always
tracebla back to an application error.

To find out what the session has last done before it started idling you
would need to turn on statement logging. Then at least you might be able
to trace down in which part of you application this was caused.


Jan

--
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/

pgsql-admin by date:

Previous
From: "Gnanakumar"
Date:
Subject: Very long " in transaction" query
Next
From: "Albe Laurenz"
Date:
Subject: Re: Very long " in transaction" query