Re: IDLE in transaction introspection

From: Scott Mead <scottm(at)openscg(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marti Raudsepp <marti(at)juffo(dot)org>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "Andrew Dunstan *EXTERN*" <andrew(at)dunslane(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IDLE in transaction introspection
Date: 2011-11-04 14:12:00
Message-ID: CAKq0gv+D0s6S0vMDHtF-k1gkAtUbSrZeWGw3Bchcakfi6EGbBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 4, 2011 at 9:48 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> On Fri, Nov 4, 2011 at 14:42, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Marti Raudsepp <marti(at)juffo(dot)org> writes:
> >> While we're already breaking everything, we could remove the "waiting"
> >> column and use a state with value 'waiting' instead.
> >
> > -1 ... I think it's useful to see the underlying state as well as the
> > waiting flag. Also, this would represent breakage of part of the API
> > that doesn't need to be broken.
>
> I guess with the changes that showed different thing like fastpath,
> that makes sense. But if we just mapped the states that are there
> today straight off, is there any case where waiting can be true, when
> we're either idle or idle in transaction? I think not..
>

Leave the waiting column and display 'WAITING' if st_watiting = 1 seems
to be the clearest solution. I can see people getting confused by waiting
= 't' and state='RUNNING'.

>
>
> >> Also, returning these as text seems a little lame. Should there be an
> >> enum type for that?
> >
> > Perhaps, but we don't really use enum types in any other system views,
> > so inventing one here would be out of character.
>
> Yeha, that seems inconsistent. Using a single character might work -
> but it's not particularly user-friendly to do that in the view itself.
>

I'll nuke the '<>', which is definitely an improvement, anything more
complex seems like it'll require fairly wordy documentation.

--
Scott Mead
OpenSCG http://www.openscg.com

>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-11-04 14:12:19 Re: Show sequences owned by
Previous Message Josh Kupershmidt 2011-11-04 14:11:28 Re: Show statistics target in \d+