Lists: | pgsql-generalpgsql-hackers |
---|
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-10 18:36:41 |
Message-ID: | CAKFQuwZqjz-je3Z=8JDOdYm3JM-N2UL4cuqy5VH8N75E5v1VVQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
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.
Does anyone capable agree enough to implement this?
Any suggestions for a better way to accomplish the goal?
I have a watch query whose title incorporates the name of the libpq service
name (via bash variables on Linux) so that I can verify which database it
is monitoring without having to kill the watched command and inspect the
prompt, command line, or process.
Working with 9.3 presently.
Thanks!
David J.
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 11:14:10 |
Message-ID: | CAB7nPqRwP_bOZU9pUQ7G1xJ8SPdHf_BgtqHQxF_ehoqKtb7NYA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 사이트SQL Postg토토 사이트 추천SQL |
On Mon, Jan 11, 2016 at 3:36 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> 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.
Yeah, this sounds like a good idea to show it at each iteration if the
title is set. I am not sure we would want to treat that as a bug fix
as nothing is broken, it looks more like a new feature.
> Any suggestions for a better way to accomplish the goal?
What I have been doing in such cases until now is updating the name of
the terminal tab to identify what was going on.
--
Michael
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 15:14:33 |
Message-ID: | 12682.1452525273@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Mon, Jan 11, 2016 at 3:36 AM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> 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.
> Yeah, this sounds like a good idea to show it at each iteration if the
> title is set.
Perhaps we should replace the "Watch every Ns" text by the user-given
title if a title has been set? That would conserve screen space.
regards, tom lane
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 15:24:10 |
Message-ID: | CAKFQuwZWcBSB56Ub5rtp8R-09gsamNWDHBME29b0fXYy3X8Suw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Jan 11, 2016 at 8:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> > On Mon, Jan 11, 2016 at 3:36 AM, David G. Johnston
> > <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >> 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.
>
> > Yeah, this sounds like a good idea to show it at each iteration if the
> > title is set.
>
> Perhaps we should replace the "Watch every Ns" text by the user-given
> title if a title has been set? That would conserve screen space.
>
The extra line doesn't both me and given the length of the timestamp I
suspect many titles would cause the combined line length to exceed terminal
width and cause wrapping anyway. In my specific case it would though I am
using an abnormally narrow width.
David J.
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 15:36:58 |
Message-ID: | CAKFQuwbCvGYUV3BGmEgbFw4yzR-G04aU9Dok--jVHsLof-r30Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Jan 11, 2016 at 4:14 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
> On Mon, Jan 11, 2016 at 3:36 AM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> > 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.
>
> Yeah, this sounds like a good idea to show it at each iteration if the
> title is set. I am not sure we would want to treat that as a bug fix
> as nothing is broken, it looks more like a new feature.
>
>
I would agree...but wouldn't personally argue against the bug-fix
interpretation. Given the nature of watch, that it is used for human
interaction, the odds of it being used in an automation environment - where
a change in layout could have an impact - it highly unlikely.
> Any suggestions for a better way to accomplish the goal?
>
> What I have been doing in such cases until now is updating the name of
> the terminal tab to identify what was going on.
>
>
Except I run my two monitor queries inside a tmux pane and so cannot
directly give them names. I get the point and probably a window name would
end up being sufficient.
David J.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 16:03:51 |
Message-ID: | 14985.1452528231@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Mon, Jan 11, 2016 at 8:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Perhaps we should replace the "Watch every Ns" text by the user-given
>> title if a title has been set? That would conserve screen space.
> The extra line doesn't both me and given the length of the timestamp I
> suspect many titles would cause the combined line length to exceed terminal
> width and cause wrapping anyway. In my specific case it would though I am
> using an abnormally narrow width.
You speak as though the title will be chosen without any regard for the
context it's used in, which I rather doubt. Wouldn't people pick the
title for a \watch query so that it fits? (In any case they could
force the issue by including a \n in their title...)
regards, tom lane
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-11 16:15:06 |
Message-ID: | CAKFQuwbb4zHPLG9bdNjDf_+E6gOLNhHkAEp91SeUM-4Cns4AsQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Jan 11, 2016 at 9:03 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > On Mon, Jan 11, 2016 at 8:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Perhaps we should replace the "Watch every Ns" text by the user-given
> >> title if a title has been set? That would conserve screen space.
>
> > The extra line doesn't both me and given the length of the timestamp I
> > suspect many titles would cause the combined line length to exceed
> terminal
> > width and cause wrapping anyway. In my specific case it would though I
> am
> > using an abnormally narrow width.
>
> You speak as though the title will be chosen without any regard for the
> context it's used in, which I rather doubt. Wouldn't people pick the
> title for a \watch query so that it fits? (In any case they could
> force the issue by including a \n in their title...)
>
>
True that.
I don't have a strong opinion either way. Having a single, condensed,
title line would be nice though using two in order to not be cryptic has
its own appeal.
David J.
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | "David G(dot) 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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-12 04:55:14 |
Message-ID: | CAB7nPqSv+Jo2KQjebBnG--wK9UdG91-p5EH=FidL_LmAPmMkpA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Tue, Jan 12, 2016 at 1:15 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Mon, Jan 11, 2016 at 9:03 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
>> > On Mon, Jan 11, 2016 at 8:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> >> Perhaps we should replace the "Watch every Ns" text by the user-given
>> >> title if a title has been set? That would conserve screen space.
>>
>> > The extra line doesn't both me and given the length of the timestamp I
>> > suspect many titles would cause the combined line length to exceed
>> > terminal
>> > width and cause wrapping anyway. In my specific case it would though I
>> > am
>> > using an abnormally narrow width.
>>
>> You speak as though the title will be chosen without any regard for the
>> context it's used in, which I rather doubt. Wouldn't people pick the
>> title for a \watch query so that it fits? (In any case they could
>> force the issue by including a \n in their title...)
>>
>
> True that.
>
> I don't have a strong opinion either way. Having a single, condensed, title
> line would be nice though using two in order to not be cryptic has its own
> appeal.
Just looking at that I just hacked the attached that enforces \n at
the end of the user-defined title (that's easily changeable):
=# \pset title 'foo bar'
Title is "foo bar".
=# select 1;
foo bar
?column?
----------
1
(1 row)
=# \watch 1
foo bar
Watch every 1s Tue Jan 12 13:54:04 2016
?column?
----------
1
(1 row)
--
Michael
Attachment | Content-Type | Size |
---|---|---|
psql_watch_title.patch | application/x-patch | 1.8 KB |
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-28 00:34:24 |
Message-ID: | CAKFQuwYTggSzqt7tth7pWKO6o9JfuQdxT4LGexJ0JEqr+Y5cjQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Jan 11, 2016 at 9:55 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
> On Tue, Jan 12, 2016 at 1:15 AM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> > On Mon, Jan 11, 2016 at 9:03 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>
> >> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> >> > On Mon, Jan 11, 2016 at 8:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> >> Perhaps we should replace the "Watch every Ns" text by the user-given
> >> >> title if a title has been set? That would conserve screen space.
> >>
> >> > The extra line doesn't both me and given the length of the timestamp I
> >> > suspect many titles would cause the combined line length to exceed
> >> > terminal
> >> > width and cause wrapping anyway. In my specific case it would though
> I
> >> > am
> >> > using an abnormally narrow width.
> >>
> >> You speak as though the title will be chosen without any regard for the
> >> context it's used in, which I rather doubt. Wouldn't people pick the
> >> title for a \watch query so that it fits? (In any case they could
> >> force the issue by including a \n in their title...)
> >>
> >
> > True that.
> >
> > I don't have a strong opinion either way. Having a single, condensed,
> title
> > line would be nice though using two in order to not be cryptic has its
> own
> > appeal.
>
> Just looking at that I just hacked the attached that enforces \n at
> the end of the user-defined title (that's easily changeable):
> =# \pset title 'foo bar'
> Title is "foo bar".
> =# select 1;
> foo bar
> ?column?
> ----------
> 1
> (1 row)
> =# \watch 1
> foo bar
> Watch every 1s Tue Jan 12 13:54:04 2016
>
> ?column?
> ----------
> 1
> (1 row)
> --
> Michael
>
On the code side calling it "caption" would make for less confusing
reading since "title" is already defined and "head_title" just doesn't
distinguish enough.
There doesn't seem to be any way to let the user decide - by adding a
newline to the end them-self - so a decision will have to be reached.
So how about:
+ snprintf(title, strlen(myopt.title) + 50,
+ _("Watch every %lds\t%s\t%s"),
+ sleep, head_title, asctime(localtime(&timer)));
David J
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | "David G(dot) 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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-28 04:13:56 |
Message-ID: | CAB7nPqTt+RyOz6KjfyeJb-rZLsTz9sR3c9=jFJVvQ9a8LK8uXw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
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
--
Michael
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-28 04:54:30 |
Message-ID: | CAKFQuwZnSu7wGv7oiO_epc8+AZX=TPgMLWCExHGS5miCYBqf4g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
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.
David J.
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | "David G(dot) 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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-28 13:01:03 |
Message-ID: | CAB7nPqQk3V5kUqBGWu8eY7sTDWxq+fo6Kbfi8gE95zqyo4M6qw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
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.
OK, attached is an updated patch. How does that look?
--
Michael
Attachment | Content-Type | Size |
---|---|---|
psql_watch_title-v2.patch | text/x-diff | 1.8 KB |
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-28 16:55:33 |
Message-ID: | CAKFQuwaAS4tz3A7tSJf+i6XO5zm3AL56q-QdXcXLrpM=zad93g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Thu, Jan 28, 2016 at 6:01 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
> 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.
>
> OK, attached is an updated patch. How does that look?
>
>
Could you run the following and post the result, please? I have yet to
setup a compiled-from-source installation...
\pset title 'This is a medium length title'
SELECT repeat('a', 100) \watch 5
It seems fine though I'm curious how it plays with various combinations of
narrow and wide outputs on narrow and wide terminals - specifically the
centering
aspect that occurs when the table is wider than the Watch/Time content.
The terminal width should just cause wrapping relative to a wide-enough
terminal so really it just the centering aspect when the table is wider
than the header.
Thanks!
David J.
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | "David G(dot) 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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-29 04:07:36 |
Message-ID: | CAB7nPqQkRXA5Ahcp1qxqNmkUegrzey5q-KF5FyyawDMSqYm76g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Fri, Jan 29, 2016 at 1:55 AM, David G. Johnston wrote:
> Could you run the following and post the result, please? I have yet to
> setup a compiled-from-source installation...
>
> \pset title 'This is a medium length title'
> SELECT repeat('a', 100) \watch 5
>
> It seems fine though I'm curious how it plays with various combinations of
> narrow and wide outputs on narrow and wide terminals - specifically the
> centering
>
> aspect that occurs when the table is wider than the Watch/Time content.
The
> terminal width should just cause wrapping relative to a wide-enough
terminal
> so really it just the centering aspect when the table is wider than the
> header.
No problem. Here you go:
Watch every 5s Fri Jan 29 13:06:31 2016
This is a medium length title
repeat
------------------------------------------------------------------------------------------------------
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
(1 row)
--
Michael
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(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> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-01-29 15:32:19 |
Message-ID: | CAKFQuwZeEmtCqcueUCF4F4qRXHb+OYT6W2JbM-kzWVXv-NMPcA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Thu, Jan 28, 2016 at 9:07 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
>
>
> On Fri, Jan 29, 2016 at 1:55 AM, David G. Johnston wrote:
> > Could you run the following and post the result, please? I have yet to
> > setup a compiled-from-source installation...
> >
> > \pset title 'This is a medium length title'
> > SELECT repeat('a', 100) \watch 5
> >
> > It seems fine though I'm curious how it plays with various combinations
> of
> > narrow and wide outputs on narrow and wide terminals - specifically the
> > centering
> >
> > aspect that occurs when the table is wider than the Watch/Time content.
> The
> > terminal width should just cause wrapping relative to a wide-enough
> terminal
> > so really it just the centering aspect when the table is wider than the
> > header.
>
> No problem. Here you go:
>
> Watch every 5s Fri Jan 29 13:06:31 2016
>
> This is a medium length title
> repeat
>
>
> ------------------------------------------------------------------------------------------------------
>
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> (1 row)
> --
> Michael
>
Looks good to me.
Thank You!
David J.
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: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-10 06:40:30 |
Message-ID: | CAKFQuwb1MA0EPDsUJ-rmEcnyWpxo2VzkXLLTNa2_3REvnofWkQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
Adding -hackers for consideration in the Commitfest.
Thanks!
David J.
>>>Original request by me
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)
Attachment | Content-Type | Size |
---|---|---|
psql_watch_title-v2.patch | text/x-diff | 1.8 KB |
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 |
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)
>
>
>
>
From: | David Steele <david(at)pgmasters(dot)net> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "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: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-17 22:01:09 |
Message-ID: | 56EB2925.2010402@pgmasters.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On 3/17/16 5:07 PM, David G. Johnston wrote:
> Figured out it had to be added to 2016-09...done
Hmm ... this patch is currently marked "needs review" in CF 2016-03. Am
I missing something, should this have been closed?
--
-David
david(at)pgmasters(dot)net
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | David Steele <david(at)pgmasters(dot)net> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-17 23:00:11 |
Message-ID: | 15244.1458255611@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
David Steele <david(at)pgmasters(dot)net> writes:
> On 3/17/16 5:07 PM, David G. Johnston wrote:
>> Figured out it had to be added to 2016-09...done
> Hmm ... this patch is currently marked "needs review" in CF 2016-03. Am
> I missing something, should this have been closed?
The message I saw was post-1-March. If it was in fact submitted in
time for 2016-03, then we owe it a review.
regards, tom lane
From: | David Steele <david(at)pgmasters(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Subject: | Re: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-17 23:03:29 |
Message-ID: | 56EB37C1.9000104@pgmasters.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On 3/17/16 7:00 PM, Tom Lane wrote:
> David Steele <david(at)pgmasters(dot)net> writes:
>> On 3/17/16 5:07 PM, David G. Johnston wrote:
>>> Figured out it had to be added to 2016-09...done
>
>> Hmm ... this patch is currently marked "needs review" in CF 2016-03. Am
>> I missing something, should this have been closed?
>
> The message I saw was post-1-March. If it was in fact submitted in
> time for 2016-03, then we owe it a review.
I meant to add the CF record and forgot:
https://commitfest.postgresql.org/9/480
It was added 2016-01-13 by Michael Paquier.
--
-David
david(at)pgmasters(dot)net
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | David Steele <david(at)pgmasters(dot)net> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-17 23:16:21 |
Message-ID: | 15958.1458256581@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
David Steele <david(at)pgmasters(dot)net> writes:
> On 3/17/16 7:00 PM, Tom Lane wrote:
>> The message I saw was post-1-March. If it was in fact submitted in
>> time for 2016-03, then we owe it a review.
> I meant to add the CF record and forgot:
> https://commitfest.postgresql.org/9/480
> It was added 2016-01-13 by Michael Paquier.
OK, so it looks like David's 10-Mar patch was actually just a repost of
Michael's 28-Jan patch, which was already in the queue to be reviewed in
2016-03 (and hasn't yet been). So the addition to 2016-09 was simply
erroneous and should be deleted.
regards, tom lane
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | David Steele <david(at)pgmasters(dot)net>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-18 00:35:16 |
Message-ID: | CAB7nPqSfUSMkD3ow5k0uHgqkyzFdMNDWkvtbDObvPUvyJ_VXOA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Fri, Mar 18, 2016 at 8:16 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> David Steele <david(at)pgmasters(dot)net> writes:
>> On 3/17/16 7:00 PM, Tom Lane wrote:
>>> The message I saw was post-1-March. If it was in fact submitted in
>>> time for 2016-03, then we owe it a review.
>
>> I meant to add the CF record and forgot:
>> https://commitfest.postgresql.org/9/480
>> It was added 2016-01-13 by Michael Paquier.
>
> OK, so it looks like David's 10-Mar patch was actually just a repost of
> Michael's 28-Jan patch, which was already in the queue to be reviewed in
> 2016-03 (and hasn't yet been). So the addition to 2016-09 was simply
> erroneous and should be deleted.
My mistake I guess. I should have mentioned as well on this thread
that I registered it.
--
Michael
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Steele <david(at)pgmasters(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-18 00:44:38 |
Message-ID: | CAKFQuwb2i4ZgyHtbzFOow+dzUWZNMcy57GePsJRL_-Zfj4yd0Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Thursday, March 17, 2016, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
> On Fri, Mar 18, 2016 at 8:16 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <javascript:;>> wrote:
> > David Steele <david(at)pgmasters(dot)net <javascript:;>> writes:
> >> On 3/17/16 7:00 PM, Tom Lane wrote:
> >>> The message I saw was post-1-March. If it was in fact submitted in
> >>> time for 2016-03, then we owe it a review.
> >
> >> I meant to add the CF record and forgot:
> >> https://commitfest.postgresql.org/9/480
> >> It was added 2016-01-13 by Michael Paquier.
> >
> > OK, so it looks like David's 10-Mar patch was actually just a repost of
> > Michael's 28-Jan patch, which was already in the queue to be reviewed in
> > 2016-03 (and hasn't yet been). So the addition to 2016-09 was simply
> > erroneous and should be deleted.
>
> My mistake I guess. I should have mentioned as well on this thread
> that I registered it.
>
>
And I didn't look hard enough on the CF site...sorry 'bout that. All good
now and I've learned for next time.
David J.
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, 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: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-19 14:42:51 |
Message-ID: | CA+TgmobYVUPKcJVELY0YaNHQ4OGJZb7bDqbVyWk6fxvwXpuf5w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Thu, Mar 10, 2016 at 1:40 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> Adding -hackers for consideration in the Commitfest.
I don't much like how this patch uses the arbitrary constant 50 in no
fewer than 5 locations.
Also, it seems like we could arrange for head_title to be "" rather
than NULL when myopt.title is NULL. Then instead of this:
+ if (head_title)
+ snprintf(title, strlen(myopt.title) + 50,
+ _("Watch every %lds\t%s\n%s"),
+ sleep, asctime(localtime(&timer)), head_title);
+ else
+ snprintf(title, 50, _("Watch every %lds\t%s"),
+ sleep, asctime(localtime(&timer)));
...we could just the first branch of that if all the time.
if (res == -1)
+ {
+ pg_free(title);
+ pg_free(head_title);
return false;
+ }
Instead of repeating the cleanup code, how about making this break;
then, change the return statement at the bottom of the function to
return (res != -1).
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-20 13:31:39 |
Message-ID: | CAB7nPqTfeT2e_WA01n996tTFiuhEbVCEMJfC=B_md-g510dsWw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Sat, Mar 19, 2016 at 11:42 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Mar 10, 2016 at 1:40 AM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> Adding -hackers for consideration in the Commitfest.
>
> I don't much like how this patch uses the arbitrary constant 50 in no
> fewer than 5 locations.
>
> Also, it seems like we could arrange for head_title to be "" rather
> than NULL when myopt.title is NULL. Then instead of this:
>
> + if (head_title)
> + snprintf(title, strlen(myopt.title) + 50,
> + _("Watch every %lds\t%s\n%s"),
> + sleep, asctime(localtime(&timer)), head_title);
> + else
> + snprintf(title, 50, _("Watch every %lds\t%s"),
> + sleep, asctime(localtime(&timer)));
>
> ...we could just the first branch of that if all the time.
OK, why not.
> if (res == -1)
> + {
> + pg_free(title);
> + pg_free(head_title);
> return false;
> + }
>
> Instead of repeating the cleanup code, how about making this break;
> then, change the return statement at the bottom of the function to
> return (res != -1).
OK.
And the patch attached gives the following output:
With title:
=# \watch 1
Watch every 1s Sun Mar 20 22:28:38 2016
popo
a
---
1
(1 row)
And without title:
Watch every 1s Sun Mar 20 22:29:31 2016
a
---
1
(1 row)
--
Michael
Attachment | Content-Type | Size |
---|---|---|
psql_watch_title-v3.patch | binary/octet-stream | 1.9 KB |
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 15:03:20 |
Message-ID: | CA+TgmoZv_tOow2yRQCiKChGPTZ7artnyoR6xwOvg3n1mr_7uOg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Sun, Mar 20, 2016 at 9:31 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> And the patch attached gives the following output:
> With title:
> =# \watch 1
> Watch every 1s Sun Mar 20 22:28:38 2016
> popo
> a
> ---
> 1
> (1 row)
>
> And without title:
> Watch every 1s Sun Mar 20 22:29:31 2016
>
> a
> ---
> 1
> (1 row)
And does everybody agree that this is a desirable change?
As for the patch itself, you could replace all this:
+ /*
+ * Take into account any title present in the user setup as a part of
+ * what is printed for each iteration by using it as a header.
+ */
+ if (myopt.title)
+ {
+ title_len = strlen(myopt.title);
+ title = pg_malloc(title_len + 50);
+ head_title = pg_strdup(myopt.title);
+ }
+ else
+ {
+ title_len = 0;
+ title = pg_malloc(50);
+ head_title = pg_strdup("");
+ }
...with:
head_title = pg_strdup(myopt.title != NULL ? myopt.title : "");
title_len = strlen(head_title);
title = pg_malloc(title_len + 50);
Better yet, include the + 50 in title_len, and then you don't need to
reference the number 50 again further down.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 15:17:33 |
Message-ID: | CAKFQuwag3CNfvJzsGr4RASuC-ismQ+9rt--dy4g8D_Fs9hoC5w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Mar 21, 2016 at 8:03 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sun, Mar 20, 2016 at 9:31 AM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
> > And the patch attached gives the following output:
> > With title:
> > =# \watch 1
> > Watch every 1s Sun Mar 20 22:28:38 2016
> > popo
> > a
> > ---
> > 1
> > (1 row)
>
This doesn't show the blank line above "popo" that the prior example
had...
>
> > And without title:
> > Watch every 1s Sun Mar 20 22:29:31 2016
> >
> > a
> > ---
> > 1
> > (1 row)
>
>
Unchanged from present behavior - but its not obvious that the watch line
is center-aligned
And does everybody agree that this is a desirable change?
>
Adding the title is desirable. While I'm inclined to bike-shed this
anything that gets it in I can live with and so I'm content letting the
author/committer decide where exactly things (including whitespace) appear.
It is a bit odd that the "Watch every %s...." gets centered if the result
is wide but that the title remains left-aligned.
The minimally invasive change would be the following:
>optional title<
>watch<
>(blank line)
>headers
>head-body divider
>body
>optional footer
Though I like the idea of:
>optional title
>(blank line - if Title present)
>headers
>head-body divider
>body
>optional footer
>watch
David J.
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 15:37:57 |
Message-ID: | CA+Tgmobx6xORe6Zwp1ysjPV197ZTCcw1vUnN=n=DhDZgcW1gXQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Mar 21, 2016 at 11:17 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> And does everybody agree that this is a desirable change?
>
> Adding the title is desirable. While I'm inclined to bike-shed this
> anything that gets it in I can live with and so I'm content letting the
> author/committer decide where exactly things (including whitespace) appear.
>
> It is a bit odd that the "Watch every %s...." gets centered if the result is
> wide but that the title remains left-aligned.
Well, the title isn't normally centered, but yeah, that is odd. Yeah,
that is odd. Come to think of it, I think I might have expected the
title to appear *above* "Watch every %s", not below it. That might
decrease the oddness.
As for letting the committer decide, I don't care about this
personally at all, so I'm only looking at it to be nice to the people
who do. Whatever is the consensus is OK with me. I just don't want
to get yelled at later for committing something here, so it would be
nice to see a few votes for whatever we're gonna do here.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 17:14:24 |
Message-ID: | 24397.1458580464@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Well, the title isn't normally centered, but yeah, that is odd. Yeah,
> that is odd. Come to think of it, I think I might have expected the
> title to appear *above* "Watch every %s", not below it. That might
> decrease the oddness.
AFAICS, it appears *beside* it with this patch. It's only below if the
terminal is narrow enough that it wraps to there.
> As for letting the committer decide, I don't care about this
> personally at all, so I'm only looking at it to be nice to the people
> who do. Whatever is the consensus is OK with me. I just don't want
> to get yelled at later for committing something here, so it would be
> nice to see a few votes for whatever we're gonna do here.
I'm still of the opinion that what would make the most sense is to replace
the "Watch every Ns" text with the user-given title, if there is one.
I ran that up the flagpole already and didn't get a lot of salutes, but
it seems to respond to your concern that the user title ought to be first.
Regardless of that, I concur with your complaints about coding style, in
particular with the need to repeat the magic constant 50 in several
places. Also, I think the patch makes do_watch return the wrong result
code for the (typical) case where we exit because of query cancel not
PSQLexecWatch failure.
So on the whole, I'd do it as attached.
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
psql_watch_title-v4.patch | text/x-diff | 2.7 KB |
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 17:34:02 |
Message-ID: | CAKFQuwbKU5aZQHtUfRPwVcp46qUQYAv4yu0zqAa=ijjqbBvsdg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Mar 21, 2016 at 10:14 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > Well, the title isn't normally centered, but yeah, that is odd. Yeah,
> > that is odd. Come to think of it, I think I might have expected the
> > title to appear *above* "Watch every %s", not below it. That might
> > decrease the oddness.
>
> AFAICS, it appears *beside* it with this patch. It's only below if the
> terminal is narrow enough that it wraps to there.
>
> > As for letting the committer decide, I don't care about this
> > personally at all, so I'm only looking at it to be nice to the people
> > who do. Whatever is the consensus is OK with me. I just don't want
> > to get yelled at later for committing something here, so it would be
> > nice to see a few votes for whatever we're gonna do here.
>
> I'm still of the opinion that what would make the most sense is to replace
> the "Watch every Ns" text with the user-given title, if there is one.
> I ran that up the flagpole already and didn't get a lot of salutes, but
> it seems to respond to your concern that the user title ought to be first.
>
> Regardless of that, I concur with your complaints about coding style, in
> particular with the need to repeat the magic constant 50 in several
> places. Also, I think the patch makes do_watch return the wrong result
> code for the (typical) case where we exit because of query cancel not
> PSQLexecWatch failure.
>
> So on the whole, I'd do it as attached.
>
I'd rather not omit sleep but removing "Watch every" is fine (preferred
actually), so:
if (user_title)
snprintf(title, title_len, "%s\t%s (%lds)", user_title,
asctime(localtime(&timer)), sleep)
"""
Title Is Here Mon Mar 21 15:05:06 2016 (5s)
col1
-----
1
"""
David J.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 17:42:20 |
Message-ID: | 25416.1458582140@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> I'd rather not omit sleep but removing "Watch every" is fine (preferred
> actually), so:
> Title Is Here Mon Mar 21 15:05:06 2016 (5s)
Meh ... seems a bit awkward to me. Couldn't you include " (5s)" in the
title, if you want that info? If it's variable, you could still
accommodate that:
regression=# \set delay 5
regression=# \pset title 'My Title (':delay' s)'
Title is "My Title (5 s)".
regression=# select repeat('xyzzy',12) \watch :delay
My Title (5 s) Mon Mar 21 13:39:25 2016
repeat
--------------------------------------------------------------
xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy
(1 row)
But I don't care enough to veto it.
Anyone else have an opinion?
regards, tom lane
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 18:09:02 |
Message-ID: | CAKFQuwYzmB8DRUDvJinmfwYLoV4PVzWO3jxKqtpz0aTmnMjiDA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com <javascript:;>> writes:
> > I'd rather not omit sleep but removing "Watch every" is fine (preferred
> > actually), so:
> > Title Is Here Mon Mar 21 15:05:06 2016 (5s)
>
> Meh ... seems a bit awkward to me. Couldn't you include " (5s)" in the
> title, if you want that info? If it's variable, you could still
> accommodate that:
Actually, only if it's a variable that you setup and repeat and you show.
A bit cumbersome and mixes the parts that are title and those that are
present only because you are watching.
> regression=# \set delay 5
> regression=# \pset title 'My Title (':delay' s)'
> Title is "My Title (5 s)".
> regression=# select repeat('xyzzy',12) \watch :delay
>
David J.
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 18:27:27 |
Message-ID: | CA+TgmoasmdUxqkQip+dir=7JvGy78q_52T7FHM+r8619VPvjcw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Mon, Mar 21, 2016 at 2:09 PM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
>> > I'd rather not omit sleep but removing "Watch every" is fine (preferred
>> > actually), so:
>> > Title Is Here Mon Mar 21 15:05:06 2016 (5s)
>>
>> Meh ... seems a bit awkward to me. Couldn't you include " (5s)" in the
>> title, if you want that info? If it's variable, you could still
>> accommodate that:
>
> Actually, only if it's a variable that you setup and repeat and you show. A
> bit cumbersome and mixes the parts that are title and those that are present
> only because you are watching.
Ah, come on. This doesn't really seem like an issue we should spend
more time quibbling about. I think Tom's version is fine.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 18:51:53 |
Message-ID: | CAKFQuwbn_oK52n-mtC4WHUqNti53PZng_9aY5ESwcTN97fhDEA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Monday, March 21, 2016, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Mar 21, 2016 at 2:09 PM, David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com <javascript:;>> wrote:
> > On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us <javascript:;>>
> wrote:
> >> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com <javascript:;>> writes:
> >> > I'd rather not omit sleep but removing "Watch every" is fine
> (preferred
> >> > actually), so:
> >> > Title Is Here Mon Mar 21 15:05:06 2016 (5s)
> >>
> >> Meh ... seems a bit awkward to me. Couldn't you include " (5s)" in the
> >> title, if you want that info? If it's variable, you could still
> >> accommodate that:
> >
> > Actually, only if it's a variable that you setup and repeat and you
> show. A
> > bit cumbersome and mixes the parts that are title and those that are
> present
> > only because you are watching.
>
> Ah, come on. This doesn't really seem like an issue we should spend
> more time quibbling about. I think Tom's version is fine.
>
>
Tom doesn't care enough to veto and you don't really care...
I'll admit it's awkward because it's abbreviated but if someone enters
\watch 5 and then sees (5s) in the title I think they can put two and two
together.
If the watched query takes a long to run, or there is a disruption, knowing
when the last one ran and how often it is supposed to run is useful info to
have at ones fingertips. I have done this myself occasionally so I'm not
speaking from theory. But I won't complain if its removed.
David J.
From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 19:01:28 |
Message-ID: | 20160321190128.GA406025@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
David G. Johnston wrote:
> Tom doesn't care enough to veto and you don't really care...
>
> I'll admit it's awkward because it's abbreviated but if someone enters
> \watch 5 and then sees (5s) in the title I think they can put two and two
> together.
>
> If the watched query takes a long to run, or there is a disruption, knowing
> when the last one ran and how often it is supposed to run is useful info to
> have at ones fingertips. I have done this myself occasionally so I'm not
> speaking from theory. But I won't complain if its removed.
I like David's UI better FWIW.
(I'll also use this opportunity to complain again about not being able
to use floating point sleep time.)
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 19:11:21 |
Message-ID: | 28869.1458587481@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> I'll admit it's awkward because it's abbreviated but if someone enters
> \watch 5 and then sees (5s) in the title I think they can put two and two
> together.
Where I find this to be awkward is that the format is randomly different
between the user-title and no-user-title cases.
What about just discarding the old format entirely, and printing one of
these two things:
Timestamp (every Ns)
User Given Title <tab> Timestamp (every Ns)
> If the watched query takes a long to run, or there is a disruption, knowing
> when the last one ran and how often it is supposed to run is useful info to
> have at ones fingertips.
That's not unreasonable. I just want it to look less weirdly different
between the two cases.
regards, tom lane
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 19:11:59 |
Message-ID: | 28908.1458587519@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> (I'll also use this opportunity to complain again about not being able
> to use floating point sleep time.)
That's not unreasonable either, though it seems like material for a
separate patch.
regards, tom lane
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 19:25:57 |
Message-ID: | CAKFQuwbn7Jd6BxCOW11-_u=EMjMr7ohfk+gah=iUiqr0Gpndig@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com <javascript:;>> writes:
> > I'll admit it's awkward because it's abbreviated but if someone enters
> > \watch 5 and then sees (5s) in the title I think they can put two and two
> > together.
>
> Where I find this to be awkward is that the format is randomly different
> between the user-title and no-user-title cases.
>
> What about just discarding the old format entirely, and printing one of
> these two things:
>
> Timestamp (every Ns)
>
> User Given Title <tab> Timestamp (every Ns)
>
>
This works for me.
David J.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 21:25:04 |
Message-ID: | 1988.1458595504@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> What about just discarding the old format entirely, and printing one of
>> these two things:
>>
>> Timestamp (every Ns)
>>
>> User Given Title <tab> Timestamp (every Ns)
> This works for me.
If I don't hear objections PDQ, I'm going to update the docs and commit
it like that.
regards, tom lane
From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-21 21:27:14 |
Message-ID: | 20160321212714.GA419960@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
Tom Lane wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> What about just discarding the old format entirely, and printing one of
> >> these two things:
> >>
> >> Timestamp (every Ns)
> >>
> >> User Given Title <tab> Timestamp (every Ns)
>
> > This works for me.
>
> If I don't hear objections PDQ, I'm going to update the docs and commit
> it like that.
It works for me too.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-22 00:59:34 |
Message-ID: | CAB7nPqSLaHbdFJEtTpp06xaipJA0uNE=YKQvPDncDGarheO+vw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Tue, Mar 22, 2016 at 6:25 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> If I don't hear objections PDQ, I'm going to update the docs and commit
> it like that.
Thanks!
--
Michael
From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Request - repeat value of \pset title during \watch interations |
Date: | 2016-03-22 01:51:04 |
Message-ID: | CAKFQuwZ_U=U-5rUjqO5J2wquQRDwCvEMA4V1Vtus0WOTCmT1qg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general pgsql-hackers |
On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com <javascript:;>> writes:
> > On Monday, March 21, 2016, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us <javascript:;>>
> wrote:
> >> What about just discarding the old format entirely, and printing one of
> >> these two things:
> >>
> >> Timestamp (every Ns)
> >>
> >> User Given Title <tab> Timestamp (every Ns)
>
> > This works for me.
>
> If I don't hear objections PDQ, I'm going to update the docs and commit
> it like that.
>
>
Saw it go in. Thank You.
David J.