Re: psql's \watch is broken

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql's \watch is broken
Date: 2019-12-14 03:49:45
Message-ID: CAMkU=1xQ+-yy3Y6jbzgy6SN0jXzwNab3w7QaVwJKGW-VYK4MkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 13, 2019 at 9:45 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Sat, Dec 14, 2019 at 12:09:51AM +0100, Fabien COELHO wrote:
> >
> >> explain (analyze) select * from pgbench_accounts \watch 1
> >>
> >> It behaves as expected. But once I break out of the loop with ctrl-C,
> then
> >> if I execute the same thing again it executes the command once, but
> shows
> >> no output and doesn't loop. It seems like some flag is getting set with
> >> ctrl-C, but then never gets reset.
> >>
> >>
> >> I've not dug into code itself, I just bisected it.
> >
> > Thanks for the report. I'll look into it.
>
> Looked at it already. And yes, I can see the difference. This comes
> from the switch from cancel_pressed to CancelRequested in psql,
> especially PSQLexecWatch() in this case. And actually, now that I
> look at it, I think that we should simply get rid of cancel_pressed in
> psql completely and replace it with CancelRequested. This also
> removes the need of having cancel_pressed defined in print.c, which
> was not really wanted originally. Attached is a patch which addresses
> the issue for me, and cleans up the code while on it. Fabien, Jeff,
> can you confirm please?
> --
> Michael
>

This works for me.

Thanks,

Jeff

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-12-14 04:05:51 Re: checkpointer: PANIC: could not fsync file: No such file or directory
Previous Message Thomas Munro 2019-12-14 03:49:22 Re: checkpointer: PANIC: could not fsync file: No such file or directory