Re: proposal - psql - use pager for \watch command
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-01-08T09:35:28Z
Lists: pgsql-hackers
Attachments
- psql-PSQL_WATCH_PAGER.patch (text/x-patch) patch
ne 19. 4. 2020 v 19:27 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal: > Hi, > > last week I finished pspg 3.0 https://github.com/okbob/pspg . pspg now > supports pipes, named pipes very well. Today the pspg can be used as pager > for output of \watch command. Sure, psql needs attached patch. > > 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. > > If you want to test proposed feature, you need a pspg with cb4114f98318344d162a84b895a3b7f8badec241 > commit. > > Then you can set your env > > export PSQL_WATCH_PAGER="pspg --stream" > psql > > SELECT * FROM pg_stat_database; > \watch 1 > > Comments, notes? > > Regards > > Pavel > rebase
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