summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tupconvert.h2
-rw-r--r--src/include/executor/execPartition.h4
-rw-r--r--src/include/executor/executor.h6
-rw-r--r--src/include/nodes/execnodes.h9
4 files changed, 16 insertions, 5 deletions
diff --git a/src/include/access/tupconvert.h b/src/include/access/tupconvert.h
index 66c0ed0882a..9137c875b29 100644
--- a/src/include/access/tupconvert.h
+++ b/src/include/access/tupconvert.h
@@ -16,6 +16,7 @@
#include "access/htup.h"
#include "access/tupdesc.h"
+#include "nodes/bitmapset.h"
typedef struct TupleConversionMap
@@ -43,6 +44,7 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
const char *msg);
extern HeapTuple do_convert_tuple(HeapTuple tuple, TupleConversionMap *map);
+extern Bitmapset *execute_attr_map_cols(Bitmapset *inbitmap, TupleConversionMap *map);
extern void free_conversion_map(TupleConversionMap *map);
diff --git a/src/include/executor/execPartition.h b/src/include/executor/execPartition.h
index 6c22901e8f9..3f6f87f8a36 100644
--- a/src/include/executor/execPartition.h
+++ b/src/include/executor/execPartition.h
@@ -173,13 +173,13 @@ typedef struct PartitionPruneState
} PartitionPruneState;
extern PartitionTupleRouting *ExecSetupPartitionTupleRouting(ModifyTableState *mtstate,
- Relation rel);
+ ResultRelInfo *rootResultRelInfo);
extern int ExecFindPartition(ResultRelInfo *resultRelInfo,
PartitionDispatch *pd,
TupleTableSlot *slot,
EState *estate);
extern ResultRelInfo *ExecInitPartitionInfo(ModifyTableState *mtstate,
- ResultRelInfo *resultRelInfo,
+ ResultRelInfo *rootResultRelInfo,
PartitionTupleRouting *proute,
EState *estate, int partidx);
extern void ExecInitRoutingInfo(ModifyTableState *mtstate,
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 97b1c0f67d3..e2252940910 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -15,6 +15,7 @@
#define EXECUTOR_H
#include "executor/execdesc.h"
+#include "executor/execPartition.h"
#include "nodes/parsenodes.h"
#include "utils/memutils.h"
@@ -184,7 +185,7 @@ extern void CheckValidResultRel(ResultRelInfo *resultRelInfo, CmdType operation)
extern void InitResultRelInfo(ResultRelInfo *resultRelInfo,
Relation resultRelationDesc,
Index resultRelationIndex,
- Relation partition_root,
+ ResultRelInfo *partition_root_rri,
int instrument_options);
extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid);
extern void ExecCleanUpTriggerState(EState *estate);
@@ -544,6 +545,9 @@ extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
extern int ExecTargetListLength(List *targetlist);
extern int ExecCleanTargetListLength(List *targetlist);
+extern Bitmapset *ExecGetInsertedCols(ResultRelInfo *relinfo, EState *estate);
+extern Bitmapset *ExecGetUpdatedCols(ResultRelInfo *relinfo, EState *estate);
+
/*
* prototypes from functions in execIndexing.c
*/
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 092843ed800..77ada4377f3 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -457,8 +457,13 @@ typedef struct ResultRelInfo
/* partition check expression state */
ExprState *ri_PartitionCheckExpr;
- /* relation descriptor for root partitioned table */
- Relation ri_PartitionRoot;
+ /*
+ * RootResultRelInfo gives the target relation mentioned in the query, if
+ * it's a partitioned table. It is not set if the target relation
+ * mentioned in the query is an inherited table, nor when tuple routing is
+ * not needed.
+ */
+ struct ResultRelInfo *ri_RootResultRelInfo;
/* true if ready for tuple routing */
bool ri_PartitionReadyForRouting;