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

From: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
To: Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: display previous query string of idle-in-transaction
Date: 2009-03-27 07:38:06
Message-ID: 1d4e0c10903270038s1785d37ai80b82e70f3287a24@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 27, 2009 at 8:27 AM, Guillaume Smet
<guillaume(dot)smet(at)gmail(dot)com> wrote:
> 2009/3/27 Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>:
>> But if I can also check last query string, I guess which apllication
>> do that and point out the problem point.
>
> Oh, I just understand why you want this patch. I usually have one
> database per server so I didn't see your point.

Thinking a bit more about it: the datname column in the
pg_stat_activity view gives you the database concerned and usename the
user used. So I still don't see your point: you can use different user
to distinguish the applications.

Moreover, if you're using connection pooling (which is more and more
common) and the same user for connecting to the database, you won't be
able to know if it's really the last query which causes the problem
(from my experience, it's usually not).

Being able to detect which application is running which query on the
very same database with the very same user seems like something not so
obvious and the use case seems to be pretty narrow. And IMHO, even if
we suppose you can make the difference between the applications with
only one query, you won't be able to limit your investigation to this
application.

So, in fact, I'm still not convinced. Could you detail a bit more how
you plan to use it?

--
Guillaume

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuhito Kasahara 2009-03-27 07:49:56 Re: display previous query string of idle-in-transaction
Previous Message Simon Riggs 2009-03-27 07:36:58 Re: display previous query string of idle-in-transaction