proposal - psql - use pager for \watch command

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal - psql - use pager for \watch command
Date: 2020-04-19 17:27:31
Message-ID: CAFj8pRBfzUUPz-3gN5oAzto9SDuRSq-TQPfXU_P6h0L7hO+Ehg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
psql-PSQL_WATCH_PAGER.patch text/x-patch 5.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2020-04-19 18:59:50 Re: PG compilation error with Visual Studio 2015/2017/2019
Previous Message Tom Lane 2020-04-19 16:59:52 Re: Poll: are people okay with function/operator table redesign?