Re: proposal - psql - use pager for \watch command
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-07-01T21:03:30Z
Lists: pgsql-hackers
st 1. 7. 2020 v 22:41 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal: > Pavel Stehule <pavel.stehule@gmail.com> writes: > > I propose new psql environment variable PSQL_WATCH_PAGER. When this > > variable is not empty, then \watch command starts specified pager, and > > redirect output to related pipe. When pipe is closed - by pager, then > > \watch cycle is leaved. > > I dunno, this just seems really strange. With any normal pager, > you'd get completely unusable behavior (per the comments that you > didn't bother to change). Also, how would the pager know where > the boundaries between successive query outputs are? If it does > not know, seems like that's another decrement in usability. > This feature is designed for specialized pagers - now only pspg can work in this mode. But pspg is part of RH, Fedora, Debian, and it is available on almost Unix platforms. https://github.com/okbob/pspg the pspg knows the psql output format of \watch statement. The usability of this combination - psql \watch and pspg is really good. Regards Pavel > regards, tom lane >
Commits
-
Fix \watch's interaction with libedit on ^C.
- 7c5953b7b5dc 10.22 landed
- 21ed12b14a32 11.17 landed
- 09224a35cdaa 12.12 landed
- e5b5b4448ce0 13.8 landed
- ab7fef0acfbd 14.5 landed
- 31b485f883a7 15.0 landed
- 21267b647719 16.0 landed
-
Add PSQL_WATCH_PAGER for psql's \watch command.
- 7c09d2797ecd 15.0 landed
-
psql: Show all query results by default
- 3a5130672296 14.0 cited
-
Add a comment warning against use of pg_usleep() for long sleeps.
- 8c1a71d36f5d 9.4.0 cited