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

From Pavel Stehule
Subject Re: proposal - psql - use pager for \watch command
Date
Msg-id CAFj8pRA0ucvVfPmgON_XcofRgkdHBnceMKG3YQ34-s0m5g5ncg@mail.gmail.com
Whole thread Raw
In response to proposal - psql - use pager for \watch command  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal - psql - use pager for \watch command
List pgsql-hackers


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


Attachment

pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Add session statistics to pg_stat_database
Next
From: Laurenz Albe
Date:
Subject: Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)