pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow SIGINT to cancel psql database reconnections.
Date: Tue, 02 Apr 2024 14:30:30 +0000
Message-ID: <E1rrf9i-0008pj-Au@gemulon.postgresql.org> (raw)

Allow SIGINT to cancel psql database reconnections.

After installing the SIGINT handler in psql, SIGINT can no longer cancel
database reconnections. For instance, if the user starts a reconnection
and then needs to do some form of interaction (ie psql is polling),
there is no way to cancel the reconnection process currently.

Use PQconnectStartParams() in order to insert a cancel_pressed check
into the polling loop.

Tristan Partin, reviewed by Gurjeet Singh, Heikki Linnakangas, Jelte
Fennema-Nio, and me.

Discussion: http://postgr.es/m/D08WWCPVHKHN.3QELIKZJ2D9RZ@neon.tech

Branch
------
master

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

Modified Files
--------------
src/bin/psql/command.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 71 insertions(+), 1 deletion(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1rrf9i-0008pj-Au@gemulon.postgresql.org>
Permalink:  ../E1rrf9i-0008pj-Au@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rrf9i-0008pj-Au@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow SIGINT to cancel psql database reconnections.
  In-Reply-To: <E1rrf9i-0008pj-Au@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