RE: psql - add SHOW_ALL_RESULTS option

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: psql - add SHOW_ALL_RESULTS option
Date: 2021-04-07 14:02:10
Message-ID: alpine.DEB.2.22.394.2104071516470.2724014@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello,

> I met a problem after commit 3a51306722.
>
> While executing a SQL statement with psql, I can't interrupt it by pressing ctrl+c.
>
> For example:
> postgres=# insert into test select generate_series(1,10000000);
> ^C^CINSERT 0 10000000
>
> Press ctrl+c before finishing INSERT, and psql still continuing to INSERT.

I can confirm this unexpected change of behavior on this commit. This is
indeed e bug.

> Is it the result expected?

Obviously not.

> And I think maybe it is better to allow users to interrupt by pressing
> ctrl+c.

Obviously yes.

The problem is that the cancellation stuff is cancelled too early after
sending an asynchronous request.

Attached a patch which attempts to fix this by moving the cancellation
cancelling request after processing results.

--
Fabien.

Attachment Content-Type Size
fix-cancel-1.patch text/x-diff 658 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2021-04-07 14:04:11 Cost model improvement for run-time partition prune
Previous Message Bharath Rupireddy 2021-04-07 13:55:22 Re: [PATCH] Improve treatment of page special and page header alignment during page init.