Re: display previous query string of idle-in-transaction

From: Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>
To: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
Cc: depesz(at)depesz(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: display previous query string of idle-in-transaction
Date: 2009-03-26 08:16:07
Message-ID: 49CB39C7.2000008@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Guillaume Smet wrote:
> On Wed, Mar 25, 2009 at 5:48 PM, hubert depesz lubaczewski
> <depesz(at)depesz(dot)com> wrote:
>> I would love to get it, but when I suggested it some time in the past
>> Tom shot it down as bad idea.
>>
>> http://archives.postgresql.org/message-id/20071016132131.GA4438@depesz.com
>
> I agree with Tom here. I tracked a lot of idle in transaction problems
> and you need the whole sequence of queries of all the backends to
> really understand what happens.
> The last query executed is mostly useless to solve this sort of
> problem. At least, it was for me in every case I had to deal with.
I think so too. But last-query-string may be a useful *hint*.
It is a hard work to trace the whole sequence of queries.

In most cases, last query string is enough information to solve the
long transaction problem. And I want a easy way to get the informarion.
# last query string is also a key to trace queries.

"COMMIT;BEGIN;idle in transaction" is not a problem on 8.3 or later, but
"(BEGIN;)SOME SQL;idle in transaction" is a problem.

So, main purpose of displaying the last query string is ..
- check whether "idle in transaction (running long time) process
after SOME SQL" is exists or not.
- check the content of "SOME SQL".

best regards,

--
Tatsuhito Kasahara
kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-03-26 08:21:14 Re: SSL over Unix-domain sockets
Previous Message higepon 2009-03-26 07:39:41 Re: pg_dump Add dumping of comments on index columns