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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Greg Stark <stark(at)enterprisedb(dot)com>, Asko Oja <ascoja(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, decibel <decibel(at)decibel(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: display previous query string of idle-in-transaction
Date: 2009-06-05 02:22:41
Message-ID: 603c8f070906041922u7eaf0f76l8c2b7cbd3049c69b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 4, 2009 at 9:54 PM, Tatsuhito
Kasahara<kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp> wrote:
> Kevin Grittner wrote:
>>
>> Greg Stark <stark(at)enterprisedb(dot)com> wrote:
>>>
>>> Should this patch be on the commitfest page for 8.5? Or is there a
>>> consensus already that it's a bad idea?
>>>
>>> Personally I actually think this makes a lot of sense to do.
>>
>>  +1
>>  It at least gives one a reasonable chance to get a useful clue....
>
> +1
> # And I'm going to register this patch on the next commitfest page.

I don't actually remember seeing actual code to implement this - is
this a patch, or just an idea? (I guess if this gets added to the
CommitFest page there will be a pointer to the code, but somehow I
can't find it at the moment.)

The only thing I don't like about this is that I think it's kind of a
hack to shove the <IDLE> in transaction designation and the query
string into the same database column. I've never liked having to
write:

select sum(1) from pg_stat_activity where current_query = '<IDLE> in
transaction';

...and I like it even less if I now have to modify that query to use
"like". We should find some way to represent this as structured
data... maybe make a separate column called "idle" that's a boolean,
or something, and let the query column contain the most recent query
(whether or not it's still executing).

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Kerr 2009-06-05 03:23:28 [PATCH v2] Avoid manual shift-and-test logic in AllocSetFreeIndex
Previous Message Tatsuhito Kasahara 2009-06-05 01:54:59 Re: display previous query string of idle-in-transaction