Re: proposal - psql - use pager for \watch command

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal - psql - use pager for \watch command
Дата
Msg-id CAFj8pRA0ucvVfPmgON_XcofRgkdHBnceMKG3YQ34-s0m5g5ncg@mail.gmail.com
обсуждение исходный текст
Ответ на proposal - psql - use pager for \watch command  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal - psql - use pager for \watch command  (Thomas Munro <thomas.munro@gmail.com>)
Список 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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Add session statistics to pg_stat_database
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)