Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "Heikki Linnakangas" <hlinnaka(at)iki(dot)fi>, "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Jacob Champion" <jacob(dot)champion(at)enterprisedb(dot)com>
Subject: Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Date: 2026-11-04 21:39:42
Message-ID: DMMR3AATWO20.FL46ZKD16OX2@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 4 Nov 2026 at 12:12, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2026-Nov-04, Peter Eisentraut wrote:
>
> > The more I think about this, the old behavior might just be a bug. But in
> > any case, let's deal with it intentionally.
>
> Yeah, as a user I can't see ever having the intention for psql to quit
> when I Ctrl-C a running command. It's not something I think we should
> propagate.

Agreed, that psql shouldn't do that in *interactive use*. I expect
that's what you're talking about. This patchset does not change that at
all.

Peter was talking about the behaviour of Ctrl+C in *script mode* (e.g.
by using -f to execute a sql file). There Ctrl+C should imo always kill
the psql process that's running the script. That wasn't happening when
it was waiting for user input. I agree with Peter that that's a bug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-11-04 21:44:14 Re: Parallel vacuum: check XID wraparound failsafe between indexes
Previous Message Jelte Fennema-Nio 2026-11-04 21:38:37 Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore