Re: psql's \watch is broken

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql's \watch is broken
Date: 2019-12-15 20:09:56
Message-ID: 27914.1576440596@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> 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?

Given the rather small number of existing uses of CancelRequested,
I wonder if it wouldn't be a better idea to rename it to cancel_pressed?

Also, perhaps I am missing something, but I do not see anyplace in the
current code base that ever *clears* CancelRequested. How much has
this code been tested? Is it really sane to remove the setting of that
flag from psql_cancel_callback, as this patch does? Is it sane that
CancelRequested isn't declared volatile?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2019-12-15 20:45:31 Re: On disable_cost
Previous Message Tom Lane 2019-12-15 19:54:03 Re: On disable_cost