proposal - psql - use pager for \watch command - Mailing list pgsql-hackers

From Pavel Stehule
Subject proposal - psql - use pager for \watch command
Date
Msg-id CAFj8pRBfzUUPz-3gN5oAzto9SDuRSq-TQPfXU_P6h0L7hO+Ehg@mail.gmail.com
Whole thread Raw
Responses Re: proposal - psql - use pager for \watch command  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: proposal - psql - use pager for \watch command  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Poll: are people okay with function/operator table redesign?
Next
From: Ranier Vilela
Date:
Subject: Re: PG compilation error with Visual Studio 2015/2017/2019