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

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-04T06:37:04Z
Lists: pgsql-hackers

Attachments

Hi

Here is a little bit updated patch - detection of end of any child process
cannot be used on WIN32. I am not an expert on this platform, but from what
I read about it, there is no easy solution. The problem is in _popen
function. We lost the handle of the created process, and it is not possible
to find it. Writing a new implementation of _popen function looks like a
big overkill to me. We can disable this functionality there completely (on
win32) or we can accept the waiting time after pager has ended until we
detect pipe error. I hope so this is acceptable, in this moment, because a)
there are not pspg for windows (and there was only few requests for porting
there in last 4 years), b) usage of psql on mswin platform is not too wide,
c) in near future, there will be an possibility to use Unix psql on this
platform.

Regards

Pavel

Commits

  1. Fix \watch's interaction with libedit on ^C.

  2. Add PSQL_WATCH_PAGER for psql's \watch command.

  3. psql: Show all query results by default

  4. Add a comment warning against use of pg_usleep() for long sleeps.