From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
Date: Mon, 12 Jul 2021 23:53:32 +0000
Message-ID: <E1m35jw-0006Gi-Qg@gemulon.postgresql.org> (raw)
Add PSQL_WATCH_PAGER for psql's \watch command.
Allow a pager to be used by the \watch command. This works but isn't
very useful with traditional pagers like "less", so use a different
environment variable. The popular open source tool "pspg" (also by
Pavel) knows how to display the output if you set PSQL_WATCH_PAGER="pspg
--stream".
To make \watch react quickly when the user quits the pager or presses
^C, and also to increase the accuracy of its timing and decrease the
rate of useless context switches, change the main loop of the \watch
command to use sigwait() rather than a sleeping/polling loop, on Unix.
Supported on Unix only for now (like pspg).
Author: Pavel Stehule <pavel.stehule@gmail.com>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CAFj8pRBfzUUPz-3gN5oAzto9SDuRSq-TQPfXU_P6h0L7hO%2BEhg%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7c09d2797ecdf779e5dc3289497be85675f3d134
Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 28 +++++++++
src/bin/psql/command.c | 133 ++++++++++++++++++++++++++++++++++++++---
src/bin/psql/common.c | 11 ++--
src/bin/psql/common.h | 2 +-
src/bin/psql/help.c | 6 +-
src/bin/psql/startup.c | 19 ++++++
6 files changed, 184 insertions(+), 15 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tmunro@postgresql.org
Subject: Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
In-Reply-To: <E1m35jw-0006Gi-Qg@gemulon.postgresql.org>
References: <E1m35jw-0006Gi-Qg@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox