Re: fe-utils - share query cancellation code - Mailing list pgsql-hackers

From Ibrar Ahmed
Subject Re: fe-utils - share query cancellation code
Date
Msg-id CALtqXTdOJjA-+3vCbr6keHGcF+HUS9fXpVbRc-xByYuPtUks=A@mail.gmail.com
Whole thread Raw
In response to fe-utils - share query cancellation code  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: fe-utils - share query cancellation code
List pgsql-hackers


On Thu, Oct 31, 2019 at 11:43 PM Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Hello Devs,

This patch moves duplicated query cancellation code code from psql &
scripts to fe-utils, so that it is shared and may be used by other
commands.

This is because Masao-san suggested to add a query cancellation feature to
pgbench for long queries (server-side data generation being discussed, but
possibly pk and fk could use that as well).

--
Fabien.

I give a quick look and I think we can 

void
psql_setup_cancel_handler(void)
{
#ifndef WIN32
        setup_cancel_handler(psql_sigint_callback);
#else
        setup_cancel_handler();
#endif /* WIN32 */
}

to

void
psql_setup_cancel_handler(void)
{
        setup_cancel_handler(psql_sigint_callback);
}

Because it does not matter for setup_cancel_handler what we passed
because it is ignoring that in case of windows.

Hmm, need to remove the assert in the function
"setup_cancel_handler"

-- Ibrar Ahmed

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Removing alignment padding for byval types
Next
From: David Rowley
Date:
Subject: Re: Creating foreign key on partitioned table is too slow