public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Jelte Fennema-Nio <[email protected]>
To: Michael Paquier <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Jacob Champion <[email protected]>
Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Date: Sat, 4 Jul 2026 22:11:54 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 04/07/2026 01:28, Jelte Fennema-Nio wrote:
>> psql has a global variable, 'cancel_pressed', which is set in the signal
>> handler callback. Is it redundant with 'CancelRequested' that's also set
>> in the signal handler?
> 
> I did some spelunking, and yes it is redundant. Fixed in 0001

Cool!

> 5d43c3c54 mentions the --single-step flag as something that required
> further analysis. I tried --single-step with and without this commit,
> and Ctrl+C behaves the same in both. I also cannot think of a reason why
> it would behave any differently.

Hmm, me neither. Michael, it was a long time ago, but would you happen 
to remember what your concern on that was?

That said, the behavior with --single-step and Ctrl-C isn't great, with 
or without this patch. Ctrl-C doesn't work while you're stopped on the 
confirmation prompt:

postgres=# \set SINGLESTEP 1
postgres=# select 1; select 2;
/**(Single step mode: verify 
command)******************************************/
select 1;
/**(press return to proceed or enter x and return to 
cancel)*******************/
^C^C^C^C^C

Hitting Ctrl-C doesn't get you out of that prompt. It does cause the 
query to not execute, but you still need to hit enter. I find that 
surprising and I bet most users would agree.

I started to dig into that, but it's a rabbit hole. I'll start a 
separate thread to not derail this patch. Patch 0001 looks good to me, 
unless Michael remembers something we're missing.

- Heikki







view thread (24+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
  In-Reply-To: <[email protected]>

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

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