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

From Thomas Munro
Subject Re: proposal - psql - use pager for \watch command
Date
Msg-id CA+hUKG+Hxyd38uvzvBwytSGPJ8-xMQt9uGHLNYSK3hEsdSTD2A@mail.gmail.com
Whole thread Raw
In response to Re: proposal - psql - use pager for \watch command  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: proposal - psql - use pager for \watch command
List pgsql-hackers
On Sun, Mar 21, 2021 at 11:44 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> [review]

Oh, just BTW, to save confusion for others who might try this:  It
seems there is something wrong with pspg --stream on macOS, at least
when using MacPorts.  I assumed it might be just pspg 3.1.5 being too
old (that's what MacPorts has currently), so I didn't mention it
before, but I just built pspg from your github master branch and it
has the same symptom.  It doesn't seem to repaint the screen until you
press a key.  I can see that psql is doing its job, but pspg is
sitting in select() reached from ncurses wgetch():

  * frame #0: 0x000000019b4af0e8 libsystem_kernel.dylib`__select + 8
    frame #1: 0x0000000100ca0620 libncurses.6.dylib`_nc_timed_wait + 332
    frame #2: 0x0000000100c85444 libncurses.6.dylib`_nc_wgetch + 296
    frame #3: 0x0000000100c85b24 libncurses.6.dylib`wgetch + 52
    frame #4: 0x0000000100a815e4 pspg`get_event + 624
    frame #5: 0x0000000100a7899c pspg`main + 9640
    frame #6: 0x000000019b4f9f34 libdyld.dylib`start + 4

That's using MacPorts' libncurses.  I couldn't get it to build against
Apple's libcurses (some missing functions).  It's the same for both
your V2 and the fixup I posted.  When you press a key, it suddenly
catches up and repaints all the \watch updates that were buffered.

It works fine on Linux and FreeBSD though (I tried pspg 4.1.0 from
Debian's package manager, and pspg 4.3.1 from FreeBSD's).



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Thomas Munro
Date:
Subject: Re: pspg pager is finished