Re: Very long "<IDLE> in transaction" query

From: Jan Lentfer <Jan(dot)Lentfer(at)web(dot)de>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Very long "<IDLE> in transaction" query
Date: 2012-05-03 11:15:37
Message-ID: a96af08dc91e765a4cd37191a092ca64@neslonek.homeunix.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2012-05-03 14:06:05 Re: Very long "<IDLE> in transaction" query
Previous Message Gnanakumar 2012-05-03 10:18:35 Very long "<IDLE> in transaction" query