summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeCustom.c
diff options
context:
space:
mode:
authorRobert Haas2017-02-26 08:06:49 +0000
committerRobert Haas2017-02-26 08:11:12 +0000
commita315b967cc1bd43ecf3c10ea48b44a4fb0ff8d45 (patch)
tree47e76aff9009a58b6742b0b38fbd31dd64b26986 /src/backend/executor/nodeCustom.c
parent285ca26132abdd0a1adc11a21789f103c4e3f6d8 (diff)
Allow custom and foreign scans to have shutdown callbacks.
This is expected to be useful mostly when performing such scans in parallel, because in that case it allows (in combination with commit acf555bc53acb589b5a2827e65d655fa8c9adee0) nodes below a Gather to get control just before the DSM segment goes away. KaiGai Kohei, except that I rewrote the documentation. Reviewed by Claudio Freire. Discussion: http://postgr.es/m/CADyhKSXJK0jUJ8rWv4AmKDhsUh124_rEn39eqgfC5D8fu6xVuw@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeCustom.c')
-rw-r--r--src/backend/executor/nodeCustom.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/executor/nodeCustom.c b/src/backend/executor/nodeCustom.c
index 16343a56df7..d4647482905 100644
--- a/src/backend/executor/nodeCustom.c
+++ b/src/backend/executor/nodeCustom.c
@@ -202,3 +202,12 @@ ExecCustomScanInitializeWorker(CustomScanState *node, shm_toc *toc)
methods->InitializeWorkerCustomScan(node, toc, coordinate);
}
}
+
+void
+ExecShutdownCustomScan(CustomScanState *node)
+{
+ const CustomExecMethods *methods = node->methods;
+
+ if (methods->ShutdownCustomScan)
+ methods->ShutdownCustomScan(node);
+}