summaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 39d2c10bdfe..b72e605e4fe 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -19,6 +19,7 @@
#include "executor/instrument.h"
#include "nodes/params.h"
#include "nodes/plannodes.h"
+#include "nodes/relation.h"
#include "utils/reltrigger.h"
#include "utils/sortsupport.h"
#include "utils/tuplestore.h"
@@ -1504,6 +1505,45 @@ typedef struct ForeignScanState
void *fdw_state; /* foreign-data wrapper can keep state here */
} ForeignScanState;
+/* ----------------
+ * CustomScanState information
+ *
+ * CustomScan nodes are used to execute custom code within executor.
+ * ----------------
+ */
+struct CustomExecMethods;
+struct ExplainState; /* to avoid to include explain.h here */
+
+typedef struct CustomScanState
+{
+ ScanState ss;
+ uint32 flags; /* mask of CUSTOMPATH_* flags defined in relation.h*/
+ const struct CustomExecMethods *methods;
+} CustomScanState;
+
+typedef struct CustomExecMethods
+{
+ const char *CustomName;
+
+ /* EXECUTOR methods */
+ void (*BeginCustomScan)(CustomScanState *node,
+ EState *estate,
+ int eflags);
+ TupleTableSlot *(*ExecCustomScan)(CustomScanState *node);
+ void (*EndCustomScan)(CustomScanState *node);
+ void (*ReScanCustomScan)(CustomScanState *node);
+ void (*MarkPosCustomScan)(CustomScanState *node);
+ void (*RestrPosCustomScan)(CustomScanState *node);
+
+ /* EXPLAIN support */
+ void (*ExplainCustomScan)(CustomScanState *node,
+ List *ancestors,
+ struct ExplainState *es);
+ Node *(*GetSpecialCustomVar)(CustomScanState *node,
+ Var *varnode,
+ PlanState **child_ps);
+} CustomExecMethods;
+
/* ----------------------------------------------------------------
* Join State Information
* ----------------------------------------------------------------