aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/execnodes.h16
-rw-r--r--src/include/nodes/parsenodes.h9
-rw-r--r--src/include/optimizer/inherit.h2
-rw-r--r--src/include/optimizer/plancat.h3
-rw-r--r--src/include/rewrite/rewriteHandler.h3
5 files changed, 22 insertions, 11 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 580e99242be..f34d06eff4f 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -558,6 +558,19 @@ typedef struct ResultRelInfo
List *ri_ancestorResultRels;
} ResultRelInfo;
+/*
+ * To avoid an ABI-breaking change in the size of ResultRelInfo in back
+ * branches, we create one of these for each result relation for which we've
+ * computed extraUpdatedCols, and store it in EState.es_resultrelinfo_extra.
+ */
+typedef struct ResultRelInfoExtra
+{
+ ResultRelInfo *rinfo; /* owning ResultRelInfo */
+
+ /* For INSERT/UPDATE, attnums of generated columns to be computed */
+ Bitmapset *ri_extraUpdatedCols;
+} ResultRelInfoExtra;
+
/* ----------------
* AsyncRequest
*
@@ -684,6 +697,9 @@ typedef struct EState
*/
List *es_insert_pending_result_relations;
List *es_insert_pending_modifytables;
+
+ /* List of ResultRelInfoExtra structs (see above) */
+ List *es_resultrelinfo_extra;
} EState;
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 1e7280340b4..6944362c7ac 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -977,14 +977,7 @@ typedef struct PartitionCmd
* which triggers to fire and in FDWs to know which changed columns they
* need to ship off.
*
- * Generated columns that are caused to be updated by an update to a base
- * column are listed in extraUpdatedCols. This is not considered for
- * permission checking, but it is useful in those places that want to know
- * the full set of columns being updated as opposed to only the ones the
- * user explicitly mentioned in the query. (There is currently no need for
- * an extraInsertedCols, but it could exist.) Note that extraUpdatedCols
- * is populated during query rewrite, NOT in the parser, since generated
- * columns could be added after a rule has been parsed and stored.
+ * extraUpdatedCols is no longer used or maintained; it's always empty.
*
* securityQuals is a list of security barrier quals (boolean expressions),
* to be tested in the listed order before returning a row from the
diff --git a/src/include/optimizer/inherit.h b/src/include/optimizer/inherit.h
index adcb1d73722..8ebd42b757a 100644
--- a/src/include/optimizer/inherit.h
+++ b/src/include/optimizer/inherit.h
@@ -20,6 +20,8 @@
extern void expand_inherited_rtentry(PlannerInfo *root, RelOptInfo *rel,
RangeTblEntry *rte, Index rti);
+extern Bitmapset *get_rel_all_updated_cols(PlannerInfo *root, RelOptInfo *rel);
+
extern bool apply_child_basequals(PlannerInfo *root, RelOptInfo *parentrel,
RelOptInfo *childrel, RangeTblEntry *childRTE,
AppendRelInfo *appinfo);
diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h
index ad29b5d107d..b0c06ca14e1 100644
--- a/src/include/optimizer/plancat.h
+++ b/src/include/optimizer/plancat.h
@@ -74,4 +74,7 @@ extern bool has_row_triggers(PlannerInfo *root, Index rti, CmdType event);
extern bool has_stored_generated_columns(PlannerInfo *root, Index rti);
+extern Bitmapset *get_dependent_generated_columns(PlannerInfo *root, Index rti,
+ Bitmapset *target_cols);
+
#endif /* PLANCAT_H */
diff --git a/src/include/rewrite/rewriteHandler.h b/src/include/rewrite/rewriteHandler.h
index 90ecf109afc..b4f96f298b6 100644
--- a/src/include/rewrite/rewriteHandler.h
+++ b/src/include/rewrite/rewriteHandler.h
@@ -24,9 +24,6 @@ extern void AcquireRewriteLocks(Query *parsetree,
extern Node *build_column_default(Relation rel, int attrno);
-extern void fill_extraUpdatedCols(RangeTblEntry *target_rte,
- Relation target_relation);
-
extern Query *get_view_query(Relation view);
extern const char *view_query_is_auto_updatable(Query *viewquery,
bool check_cols);