aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-06-14 01:24:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-06-14 01:24:14 +0000
commit067e40cc6d1c9254c68e7ad29e7a07f14daa7eaa (patch)
treebde422a40d6a03fe152a6b39e4074336e7de0bf2 /src
parentaa30e0e555a980a186ce50ab77d222cab75c13e9 (diff)
downloadpostgresql-067e40cc6d1c9254c68e7ad29e7a07f14daa7eaa.tar.gz
postgresql-067e40cc6d1c9254c68e7ad29e7a07f14daa7eaa.zip
Do a CHECK_FOR_INTERRUPTS immediately before terminating a fastpath
function call. Previously, there may have been no CHECK_FOR_INTERRUPTS at all in the fastpath code path, making it impossible to cancel an operation such as \lo_import externally. This addition doesn't ensure you can cancel, since your SIGINT may arrive while the backend is idle waiting for the client, but it gives the largest window we can easily provide. Noted while experimenting with new control-C code for psql.
Diffstat (limited to 'src')
-rw-r--r--src/backend/tcop/fastpath.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index 3f769d9a9ad..c0ac339eaba 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.87 2006/06/11 15:49:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.88 2006/06/14 01:24:14 tgl Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@@ -382,6 +382,9 @@ HandleFunctionRequest(StringInfo msgBuf)
retval = (Datum) 0;
}
+ /* ensure we do at least one CHECK_FOR_INTERRUPTS per function call */
+ CHECK_FOR_INTERRUPTS();
+
SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat);
return 0;