pgsql: Allow SIGINT to cancel psql database reconnections.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow SIGINT to cancel psql database reconnections.
Date: 2024-04-02 14:30:30
Message-ID: E1rrf9i-0008pj-Au@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2024-04-02 14:41:58 pgsql: Unwind #if spaghetti in hmac_openssl.c a bit.
Previous Message Robert Haas 2024-04-02 14:25:38 pgsql: Expose PQsocketPoll via libpq