Refactor query cancellation code into src/fe_utils/
authorMichael Paquier <[email protected]>
Mon, 2 Dec 2019 02:18:56 +0000 (11:18 +0900)
committerMichael Paquier <[email protected]>
Mon, 2 Dec 2019 02:18:56 +0000 (11:18 +0900)
commita4fd3aa719e8f97299dfcf1a8f79b3017e2b8d8b
tree5e2abc311e6f09a3788dd2989e8ed56555975291
parentc01ac6dcba0aa65ad237c3af4a67bc70da8e4b0e
Refactor query cancellation code into src/fe_utils/

Originally, this code was duplicated in src/bin/psql/ and
src/bin/scripts/, but it can be useful for other frontend applications,
like pgbench.  This refactoring offers the possibility to setup a custom
callback which would get called in the signal handler for SIGINT or when
the interruption console events happen on Windows.

Author: Fabien Coelho, with contributions from Michael Paquier
Reviewed-by: Álvaro Herrera, Ibrar Ahmed
Discussion: https://postgr.es/m/alpine.DEB.2.21.1910311939430.27369@lancre
14 files changed:
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/common.h
src/bin/psql/large_obj.c
src/bin/psql/startup.c
src/bin/scripts/clusterdb.c
src/bin/scripts/common.c
src/bin/scripts/common.h
src/bin/scripts/reindexdb.c
src/bin/scripts/vacuumdb.c
src/fe_utils/Makefile
src/fe_utils/cancel.c [new file with mode: 0644]
src/include/fe_utils/cancel.h [new file with mode: 0644]
src/tools/msvc/Mkvcbuild.pm