Re: IDLE in transaction introspection

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Scott Mead <scottm(at)openscg(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IDLE in transaction introspection
Date: 2011-11-01 11:38:06
Message-ID: CABUevEywbhzxVBFOLZ0MGSmVk3c7qQXhnysdnc454GekUbtLoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 1, 2011 at 00:18, Scott Mead <scottm(at)openscg(dot)com> wrote:
>
>
> On Mon, Oct 31, 2011 at 6:13 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>
>> On Mon, Oct 31, 2011 at 5:45 PM, Magnus Hagander <magnus(at)hagander(dot)net>
>> wrote:
>> > Actually, for the future, it might be useful to have a "state" column,
>> > that holds the idle/in transaction/running status, instead of the
>> > tools having to parse the query text to get that information...
>>
>> +1 for doing it this way.  Splitting "current_query" into "query" and
>> "state" would be more elegant and easier to use all around.
>
> I'm all for splitting it out actually.  My concern was that I would break
> the 'ba-gillion' monitoring tools that already have support for
> pg_stat_activity if I dropped a column.  What if we had:
>    'state' :             idle | in transaction | running ( per Robert )

If we're going with breaking compatibility, "waiting" should be a
state as well, I think. Actually, it should be even if we're not
breaking compatibilty, but just adding a state field.

>    'current_query' :  the most recent query (either last / currently
> running)
>    That may be a bit tougher to get across to people though (especially in
> the case where state='<IDLE>').
>  I'll rework this when I don't have trick-or-treaters coming to the front
> door :)

I think the question is how Ok it is to break compatibility. We could
always leave current_query in there and create a new field for
last_query *and* introduce a state... And then advertise a change in
the future. But that might be too much...

If we are doing it, it might be useful to just call it "query", so
that it is dead obvious to people that the definition changed..

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-11-01 11:46:55 Re: unite recovery.conf and postgresql.conf
Previous Message Brendan Jurd 2011-11-01 10:12:46 Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?