Refactor query cancellation code into src/fe_utils/
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/psql/command.c | modified | +1 −0 |
| src/bin/psql/common.c | modified | +26 −161 |
| src/bin/psql/common.h | modified | +1 −4 |
| src/bin/psql/large_obj.c | modified | +4 −3 |
| src/bin/psql/startup.c | modified | +1 −1 |
| src/bin/scripts/clusterdb.c | modified | +1 −1 |
| src/bin/scripts/common.c | modified | +0 −147 |
| src/bin/scripts/common.h | modified | +1 −6 |
| src/bin/scripts/reindexdb.c | modified | +1 −1 |
| src/bin/scripts/vacuumdb.c | modified | +1 −1 |
| src/fe_utils/cancel.c | added | +225 −0 |
| src/fe_utils/Makefile | modified | +1 −0 |
| src/include/fe_utils/cancel.h | added | +30 −0 |
| src/tools/msvc/Mkvcbuild.pm | modified | +1 −1 |
Discussion
- fe-utils - share query cancellation code 17 messages · 2019-10-31 → 2019-12-04