Re: Request - repeat value of \pset title during \watch interations

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: Request - repeat value of \pset title during \watch interations
Date: 2016-03-17 21:07:44
Message-ID: CAKFQuwb2YzPTs4-TgWy-JzEKX7dLaFyHVX+00dD2YqWrLJTQWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Figured out it had to be added to 2016-09...done

On Wed, Mar 9, 2016 at 11:40 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> Adding -hackers for consideration in the Commitfest.
>
> Thanks!
>
> David J.
>
> >>>Original request by me
>
>
> http://www.postgresql.org/message-id/CAKFQuwZqjz-je3Z=8JDOdYm3JM-N2UL4cuqy5VH8N75E5v1VVQ@mail.gmail.com
>
> When executing a query using \watch in psql the first execution of the
> query includes "Title is [...]" when \pset title is in use. Subsequent
> executions do not. Once that first display goes off-screen the information
> in the title is no longer readily accessible. If using \watch for a
> long-running monitoring query it can be helpful to incorporate some context
> information into the title.
>
> ---------- Forwarded message ----------
> From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
> Date: Thu, Jan 28, 2016 at 6:01 AM
> Subject: Re: [GENERAL] Request - repeat value of \pset title during \watch
> interations
> To: "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
> Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <
> pgsql-general(at)postgresql(dot)org>
>
>
> On Thu, Jan 28, 2016 at 1:54 PM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> > On Wed, Jan 27, 2016 at 9:13 PM, Michael Paquier <
> michael(dot)paquier(at)gmail(dot)com>
> > wrote:
> >>
> >> On Thu, Jan 28, 2016 at 9:34 AM, David G. Johnston
> >> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >> > So how about:
> >> >
> >> > + snprintf(title, strlen(myopt.title) + 50,
> >> > + _("Watch every %lds\t%s\t%s"),
> >> > + sleep, head_title, asctime(localtime(&timer)));
> >>
> >> I would just keep the timestamp and the title separated so what do you
> >> think about that instead?
> >> Watch every Xs $timestamp
> >> $head_title
> >
> >
> > That works. I like having the title immediately above the table.
> >
> > The other option that came to mind would be to place the time information
> > after the table display while leaving the title before it. On an output
> > that requires more vertical space than is available in the terminal one
> > would no longer have to scroll up to confirm last execution time. If
> doing
> > this I'd probably get rid of any logic that attempts to center the time
> > information on the table and simply leave it left-aligned.
>
> ​And the example:
> ​
> OK, attached is an updated patch. How does that look?
>
> Watch every 5s Fri Jan 29 13:06:31 2016
>
> This is a medium length title
> repeat
>
> ------------------------------------------------------------
> ------------------------------------------
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> (1 row)
> ​
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Steele 2016-03-17 22:01:09 Re: [HACKERS] Request - repeat value of \pset title during \watch interations
Previous Message Karsten Hilbert 2016-03-17 20:45:00 Re: Schema Size - PostgreSQL 9.2

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-17 21:11:16 Re: Make primnodes.h gender neutral
Previous Message Lizeth Solis Aramayo 2016-03-17 21:00:54 postgresql 9.4 on AIX 7.1