From: | Noboru Saito <noborusai(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: Separate the result of \watch for each query execution (psql) |
Date: | 2022-03-02 00:57:21 |
Message-ID: | CAAM3qnJvw47EoiTmVsoDwVTJydRmo-8PxXJNv0SRN5_8HW9u4A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Noboru Saito <noborusai(at)gmail(dot)com> writes:
> > I have created a patch that allows you to turn it on and off in \pset.
> > The attached patch adds the following features.
> > Formfeed can be turned on with the command line option or \pset.
> > Formfeed (\f\n) is output after the query execution result by \watch.
>
> Hmm ... I grant your use-case for this, but I think the patch
> is too narrow-minded, because it supposes that the only string
> anybody could wish to output between \watch commands is "\f\n".
> Once you open the floodgates of inserting formatting there,
> ISTM that people might want other things.
>
> Also, I'm not that thrilled with treating this as a \pset option,
> because it has nothing to do with formatting of normal query
> results. (IMV anyway, perhaps others will disagree.)
>
> How about instead of defining fixed semantics, we invent a psql
> special variable that can contain a string to be output between
> \watch commands? It looks like you could then set it through
> a command like
I understand because it's a problem I was worried about.
However, we need a machine-readable string for PAGER.
It didn't exist before, so newcomers will match it to a fixed string.
The de facto standard is required even if it can be changed.
> \set WATCH_SEPARATOR '\f\n'
>
> (not wedded to that variable name, it's just the first idea
> that came to mind)
I think it's better not to include "WATCH" in the name,
as it may be used in the future other than \watch.
> Personally I'd not bother with inventing a specialized command-line
> option to set it, either. There's already -v and friends.
>
> > * Is formfeed output after the result, not before?
>
> Or we could invent WATCH_BEFORE and WATCH_AFTER ...
>
> regards, tom lane
It may be good to add it in the future.
For now, I'm fine with either one.
Thank you.
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2022-03-02 01:03:02 | Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file |
Previous Message | Peter Smith | 2022-03-02 00:34:17 | Re: Optionally automatically disable logical replication subscriptions on error |