Re: 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: Re: proposal - psql - use pager for \watch command
Date: 2021-01-08 09:35:28
Message-ID: CAFj8pRA0ucvVfPmgON_XcofRgkdHBnceMKG3YQ34-s0m5g5ncg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ne 19. 4. 2020 v 19:27 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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 Content-Type Size
psql-PSQL_WATCH_PAGER.patch text/x-patch 5.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2021-01-08 09:53:35 Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)
Previous Message Laurenz Albe 2021-01-08 09:34:24 Re: Add session statistics to pg_stat_database