Re: [PATCHES] Small patch to replace 'idle' by 'trans' if transactionis still open

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Christof Petig <christof(at)petig-baender(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] Small patch to replace 'idle' by 'trans' if transactionis still open
Date: 2001-01-24 03:46:51
Message-ID: 200101240346.WAA27707@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Any solid consensus on this?

>
> Well, I'm still for this ... how about something simiple like 'idle in
> trans'? show, and easy to figure out what it means?
>
> On Mon, 22 Jan 2001, Christof Petig wrote:
>
> > If you don't know what is all about read the bottom (I'll requote my posting)
> >
> > Bruce Momjian wrote:
> >
> > > > On Fri, 19 Jan 2001, Bruce Momjian wrote:
> > > > > Seems we decided against this. Sorry.
> > > >
> > > > Huh? from reading Tom's response, sounds like it would be something
> > > > useful? I know I find having as much information about state in the ps
> > > > listing helps me alot, and knowing if its 'idle' vs 'idle (in
> > > > transaction)' provides at lesat more detailed information then just 'idle'
> > >
> > > > Who was the 'we' in the above decision? Tom seemed in favor of it, I know
> > > > I'm in favor of it .. and you are not in favor of it ...
> > >
> > > There must have been some discussion about it. I don't see it in the
> > > code, and I remember it was rejected for some reason. Check the archives.
> >
> > The thing which comes most close to a rejection was the 'I can't decide' mail
> > by you (answered by Tom). The conclusion sounded like 'since we're not clear on
> > this subject we won't touch this, yet'. And there was some unsettled discussion
> > about the best wording to show in 'ps'.
> >
> > 'trans' seemed too short (and too much unlike 'idle') (as indicated by Bruce)
> > and 'idle (open transaction)' might give difficulties on platforms which limit
> > the length of the string (as indicated by Tom)
> >
> > I'll CC Hackers (where this discussion belongs)
> >
> > Christof
> >
> > ---------------------
> >
> > Quoting:
> >
> > Subject: Re: [PATCHES] Small patch to replace 'idle' by 'trans' if transaction
> > is still open
> > Date: Mon, 09 Oct 2000 22:46:56 -0400
> > From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> >
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > I can't decide if this is of general use. My inclination is that
> > > someone in a transaction sitting a prompt should still show as idle.
> >
> > The idea seemed good to me, although I didn't look at the code to see
> > if the implementation was any good ;-). I know we've frequently had
> > questions on the lists where it was interesting to know if any
> > transactions were being held open --- and right now there's no easy
> > way to tell.
> >
> > regards, tom lane
> >
> > --------------
> >
> > Subject: Small patch to replace 'idle' by 'trans' if transaction is still open
> > Date: Tue, 03 Oct 2000 21:28:36 +0200
> > From: Christof Petig <christof(dot)petig(at)wtal(dot)de>
> >
> > If you are looking for programs which tend to hold longstanding
> > transactions, this micro patch might be handy.
> > Whether it is of general use is debatable. It will replace 'idle' by
> > 'trans' if the backend is idle but a transaction is pending.
> >
> > Simply use ps to view the backend's status.
> >
> > Christof
> >
> > --- src/backend/commands/async.c~ Sun May 14 05:18:35 2000
> > +++ src/backend/commands/async.c Tue Oct 3 10:31:54 2000
> > @@ -818,7 +818,7 @@
> > */
> > pq_flush();
> >
> > - PS_SET_STATUS("idle");
> > + PS_SET_STATUS(IsTransactionBlock()?"trans":"idle");
> > TPRINTF(TRACE_NOTIFY, "ProcessIncomingNotify: done");
> > }
> >
> > --- src/backend/tcop/postgres.c~ Thu Aug 31 09:18:57 2000
> > +++ src/backend/tcop/postgres.c Tue Oct 3 10:32:23 2000
> > @@ -1496,7 +1496,7 @@
> >
> > for (;;)
> > {
> > - PS_SET_STATUS("idle");
> > + PS_SET_STATUS(IsTransactionBlock()?"trans":"idle");
> >
> > /* ----------------
> > * (1) tell the frontend we're ready for a new query.
> >
> >
> >
>
> Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
> Systems Administrator @ hub.org
> primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-01-24 04:10:49 Re: $PGDATA/base/???
Previous Message Bruce Momjian 2001-01-24 03:46:14 Re: [PATCHES] update to contrib/pgcrypto

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-01-24 03:50:07 Re: Re: patch for src/backend/main/main.c
Previous Message Bruce Momjian 2001-01-24 03:46:14 Re: [PATCHES] update to contrib/pgcrypto