summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h49
-rw-r--r--src/include/nodes/plannodes.h44
-rw-r--r--src/include/nodes/relation.h38
3 files changed, 66 insertions, 65 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 8c8c01f1cd..40fb8243ab 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -19,7 +19,6 @@
#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"
@@ -1512,39 +1511,39 @@ typedef struct ForeignScanState
* 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;
+struct ExplainState; /* avoid including explain.h here */
+struct CustomScanState;
typedef struct CustomExecMethods
{
- const char *CustomName;
+ 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);
+ void (*BeginCustomScan) (struct CustomScanState *node,
+ EState *estate,
+ int eflags);
+ TupleTableSlot *(*ExecCustomScan) (struct CustomScanState *node);
+ void (*EndCustomScan) (struct CustomScanState *node);
+ void (*ReScanCustomScan) (struct CustomScanState *node);
+ void (*MarkPosCustomScan) (struct CustomScanState *node);
+ void (*RestrPosCustomScan) (struct CustomScanState *node);
/* EXPLAIN support */
- void (*ExplainCustomScan)(CustomScanState *node,
- List *ancestors,
- struct ExplainState *es);
- Node *(*GetSpecialCustomVar)(CustomScanState *node,
- Var *varnode,
- PlanState **child_ps);
+ void (*ExplainCustomScan) (struct CustomScanState *node,
+ List *ancestors,
+ struct ExplainState *es);
+ Node *(*GetSpecialCustomVar) (struct CustomScanState *node,
+ Var *varnode,
+ PlanState **child_ps);
} CustomExecMethods;
+typedef struct CustomScanState
+{
+ ScanState ss;
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see relation.h */
+ const CustomExecMethods *methods;
+} CustomScanState;
+
/* ----------------------------------------------------------------
* Join State Information
* ----------------------------------------------------------------
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 9dbb91cb90..dd300b1a19 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -18,7 +18,6 @@
#include "lib/stringinfo.h"
#include "nodes/bitmapset.h"
#include "nodes/primnodes.h"
-#include "nodes/relation.h"
#include "utils/lockwaitpolicy.h"
@@ -486,33 +485,36 @@ typedef struct ForeignScan
} ForeignScan;
/* ----------------
- * CustomScan node
+ * CustomScan node
* ----------------
*/
-struct CustomScanMethods;
-
-typedef struct CustomScan
-{
- Scan scan;
- uint32 flags; /* mask of CUSTOMPATH_* flags defined in relation.h */
- struct CustomScanMethods *methods;
-} CustomScan;
+struct PlannerInfo; /* avoid including relation.h here */
+struct CustomScan;
typedef struct CustomScanMethods
{
const char *CustomName;
- void (*SetCustomScanRef)(struct PlannerInfo *root,
- CustomScan *cscan,
- int rtoffset);
- void (*FinalizeCustomScan)(struct PlannerInfo *root,
- CustomScan *cscan,
- bool (*finalize_primnode)(),
- void *finalize_context);
- Node *(*CreateCustomScanState)(CustomScan *cscan);
- void (*TextOutCustomScan)(StringInfo str, const CustomScan *node);
- CustomScan *(*CopyCustomScan)(const CustomScan *from);
+
+ void (*SetCustomScanRef) (struct PlannerInfo *root,
+ struct CustomScan *cscan,
+ int rtoffset);
+ void (*FinalizeCustomScan) (struct PlannerInfo *root,
+ struct CustomScan *cscan,
+ bool (*finalize_primnode) (),
+ void *finalize_context);
+ Node *(*CreateCustomScanState) (struct CustomScan *cscan);
+ void (*TextOutCustomScan) (StringInfo str,
+ const struct CustomScan *node);
+ struct CustomScan *(*CopyCustomScan) (const struct CustomScan *from);
} CustomScanMethods;
+typedef struct CustomScan
+{
+ Scan scan;
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see relation.h */
+ const CustomScanMethods *methods;
+} CustomScan;
+
/*
* ==========
* Join nodes
@@ -864,7 +866,7 @@ typedef struct PlanRowMark
Index prti; /* range table index of parent relation */
Index rowmarkId; /* unique identifier for resjunk columns */
RowMarkType markType; /* see enum above */
- LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED options */
+ LockWaitPolicy waitPolicy; /* NOWAIT and SKIP LOCKED options */
bool isParent; /* true if this is a "dummy" parent entry */
} PlanRowMark;
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index 05cfbcd2aa..7953bf7ed6 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -897,34 +897,34 @@ typedef struct ForeignPath
* the structure declared here; providers are expected to make it the first
* element in a larger structure.
*/
-
-struct CustomPathMethods;
-struct Plan; /* not to include plannodes.h here */
+struct CustomPath;
#define CUSTOMPATH_SUPPORT_BACKWARD_SCAN 0x0001
#define CUSTOMPATH_SUPPORT_MARK_RESTORE 0x0002
-typedef struct CustomPath
-{
- Path path;
- uint32 flags;
- const struct CustomPathMethods *methods;
-} CustomPath;
-
typedef struct CustomPathMethods
{
const char *CustomName;
- void (*CreateCustomScanPath)(PlannerInfo *root,
- RelOptInfo *baserel,
- RangeTblEntry *rte);
- struct Plan *(*PlanCustomPath)(PlannerInfo *root,
- RelOptInfo *rel,
- CustomPath *best_path,
- List *tlist,
- List *clauses);
- void (*TextOutCustomPath)(StringInfo str, const CustomPath *node);
+
+ void (*CreateCustomScanPath) (PlannerInfo *root,
+ RelOptInfo *baserel,
+ RangeTblEntry *rte);
+ struct Plan *(*PlanCustomPath) (PlannerInfo *root,
+ RelOptInfo *rel,
+ struct CustomPath *best_path,
+ List *tlist,
+ List *clauses);
+ void (*TextOutCustomPath) (StringInfo str,
+ const struct CustomPath *node);
} CustomPathMethods;
+typedef struct CustomPath
+{
+ Path path;
+ uint32 flags; /* mask of CUSTOMPATH_* flags, see above */
+ const CustomPathMethods *methods;
+} CustomPath;
+
/*
* AppendPath represents an Append plan, ie, successive execution of
* several member plans.