Re: Remove unnecessary code from psql's watch command

2024-03-08 Thread Yugo NAGATA
On Fri, 08 Mar 2024 12:09:12 -0500 Tom Lane wrote: > Yugo NAGATA writes: > > On Wed, 06 Mar 2024 13:03:39 -0500 > > Tom Lane wrote: > >> I don't have Windows here to test on, but does the WIN32 code > >> path work at all? > > > The outer loop is eventually exited even because PSQLexecWatch ret

Re: Remove unnecessary code from psql's watch command

2024-03-08 Thread Tom Lane
Yugo NAGATA writes: > On Wed, 06 Mar 2024 13:03:39 -0500 > Tom Lane wrote: >> I don't have Windows here to test on, but does the WIN32 code >> path work at all? > The outer loop is eventually exited even because PSQLexecWatch returns 0 > when cancel_pressed = 0. However, it happens after executi

Re: Remove unnecessary code from psql's watch command

2024-03-07 Thread Yugo NAGATA
On Wed, 06 Mar 2024 13:03:39 -0500 Tom Lane wrote: > Michael Paquier writes: > > On Tue, Mar 05, 2024 at 10:05:52PM +0900, Yugo NAGATA wrote: > >> In the current code of do_watch(), sigsetjmp is called if WIN32 > >> is defined, but siglongjmp is not called in the signal handler > >> in this cond

Re: Remove unnecessary code from psql's watch command

2024-03-06 Thread Tom Lane
Michael Paquier writes: > On Tue, Mar 05, 2024 at 10:05:52PM +0900, Yugo NAGATA wrote: >> In the current code of do_watch(), sigsetjmp is called if WIN32 >> is defined, but siglongjmp is not called in the signal handler >> in this condition. On Windows, currently, cancellation is checked >> only b

Re: Remove unnecessary code from psql's watch command

2024-03-05 Thread Michael Paquier
On Tue, Mar 05, 2024 at 10:05:52PM +0900, Yugo NAGATA wrote: > In the current code of do_watch(), sigsetjmp is called if WIN32 > is defined, but siglongjmp is not called in the signal handler > in this condition. On Windows, currently, cancellation is checked > only by cancel_pressed, and calling

Remove unnecessary code from psql's watch command

2024-03-05 Thread Yugo NAGATA
Hi, In the current code of do_watch(), sigsetjmp is called if WIN32 is defined, but siglongjmp is not called in the signal handler in this condition. On Windows, currently, cancellation is checked only by cancel_pressed, and calling sigsetjmp in do_watch() is unnecessary. Therefore, we can remove