pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve WIN32 waiting logic in psql's \watch command.
Date: Fri, 08 Mar 2024 17:07:44 +0000
Message-ID: <E1ridhA-002k9t-9l@gemulon.postgresql.org> (raw)

Improve WIN32 waiting logic in psql's \watch command.

do_watch had some leftover logic for enabling siglongjmp out of
waiting for input.  That's never done anything on Windows (cf.
psql_cancel_callback), and do_watch no longer relies on it for
non-Windows, so let's drop it.

Also, when the user cancels \watch by pressing ^C, the Windows
code would run the query one more time before exiting.  That doesn't
seem very desirable, and it's not what happens on other platforms.
Use the "done" flag similarly to non-Windows to avoid the extra query
execution.

Yugo Nagata (with minor fixes by me)

Discussion: https://postgr.es/m/20240305220552.85fd4afd6b6b8103bf4fe3d0@sraoss.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f07a20c8a3b15e71d3cbfcfed0600956042cbe74

Modified Files
--------------
src/bin/psql/command.c | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)



view thread (3+ messages)

Message-ID: <E1ridhA-002k9t-9l@gemulon.postgresql.org>
Permalink:  ../E1ridhA-002k9t-9l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ridhA-002k9t-9l@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Improve WIN32 waiting logic in psql's \watch command.
  In-Reply-To: <E1ridhA-002k9t-9l@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox