summaryrefslogtreecommitdiff
path: root/src/include/nodes/supportnodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes/supportnodes.h')
-rw-r--r--src/include/nodes/supportnodes.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/nodes/supportnodes.h b/src/include/nodes/supportnodes.h
index 7b623d54058..ea774c7ef6a 100644
--- a/src/include/nodes/supportnodes.h
+++ b/src/include/nodes/supportnodes.h
@@ -39,6 +39,8 @@ typedef struct PlannerInfo PlannerInfo; /* avoid including pathnodes.h here */
typedef struct IndexOptInfo IndexOptInfo;
typedef struct SpecialJoinInfo SpecialJoinInfo;
typedef struct WindowClause WindowClause;
+typedef struct RangeTblFunction RangeTblFunction; /* ditto for parsenodes.h */
+typedef struct HeapTupleData *HeapTuple; /* and htup.h too */
/*
* The Simplify request allows the support function to perform plan-time
@@ -70,6 +72,34 @@ typedef struct SupportRequestSimplify
} SupportRequestSimplify;
/*
+ * The InlineInFrom request allows the support function to perform plan-time
+ * simplification of a call to its target function that appears in FROM.
+ * The rules for this are sufficiently different from ordinary expressions
+ * that it's best to make this a separate request from Simplify.
+ *
+ * The planner's PlannerInfo "root" is typically not needed, but can be
+ * consulted if it's necessary to obtain info about Vars present in
+ * the given node tree. Beware that root could be NULL in some usages.
+ *
+ * "rtfunc" will be a RangeTblFunction node for the support function's target
+ * function. The call appeared alone (and without ORDINALITY) in FROM.
+ *
+ * "proc" will be the HeapTuple for the pg_proc row of the target function.
+ *
+ * The result should be a semantically-equivalent SELECT Query tree,
+ * or NULL if no simplification could be performed. The tree must have
+ * been passed through parse analysis and rewrite.
+ */
+typedef struct SupportRequestInlineInFrom
+{
+ NodeTag type;
+
+ PlannerInfo *root; /* Planner's infrastructure */
+ RangeTblFunction *rtfunc; /* Function call to be simplified */
+ HeapTuple proc; /* Function definition from pg_proc */
+} SupportRequestInlineInFrom;
+
+/*
* The Selectivity request allows the support function to provide a
* selectivity estimate for a function appearing at top level of a WHERE
* clause (so it applies only to functions returning boolean).