Allow SIGINT to cancel psql database reconnections.
authorRobert Haas <rhaas@postgresql.org>
Tue, 2 Apr 2024 14:26:10 +0000 (10:26 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 2 Apr 2024 14:26:10 +0000 (10:26 -0400)
commitcafe1056558fe07cdc52b95205588fcd80870362
tree6d2f8bab4646befac3a69a0c5ed36ac8d04abcce
parentf5e4dedfa81f00de93b1b90d06c44cc50e052eaf
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
src/bin/psql/command.c