summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h11
-rw-r--r--src/include/nodes/plannodes.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 020ecdcd40..35646231a4 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -386,12 +386,19 @@ typedef struct OnConflictSetState
* Whenever we update an existing relation, we have to update indexes on the
* relation, and perhaps also fire triggers. ResultRelInfo holds all the
* information needed about a result relation, including indexes.
+ *
+ * Normally, a ResultRelInfo refers to a table that is in the query's
+ * range table; then ri_RangeTableIndex is the RT index and ri_RelationDesc
+ * is just a copy of the relevant es_relations[] entry. But sometimes,
+ * in ResultRelInfos used only for triggers, ri_RangeTableIndex is zero
+ * and ri_RelationDesc is a separately-opened relcache pointer that needs
+ * to be separately closed. See ExecGetTriggerResultRel.
*/
typedef struct ResultRelInfo
{
NodeTag type;
- /* result relation's range table index */
+ /* result relation's range table index, or 0 if not in range table */
Index ri_RangeTableIndex;
/* relation descriptor for result relation */
@@ -479,6 +486,8 @@ typedef struct EState
Snapshot es_snapshot; /* time qual to use */
Snapshot es_crosscheck_snapshot; /* crosscheck time qual for RI */
List *es_range_table; /* List of RangeTblEntry */
+ Relation *es_relations; /* Array of per-es_range_table-entry Relation
+ * pointers, or NULL if not yet opened */
PlannedStmt *es_plannedstmt; /* link to top of plan tree */
const char *es_sourceText; /* Source text from QueryDesc */
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 7c2abbd03a..8b37437057 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -1105,7 +1105,7 @@ typedef struct PartitionPruneInfo
typedef struct PartitionedRelPruneInfo
{
NodeTag type;
- Oid reloid; /* OID of partition rel for this level */
+ Index rtindex; /* RT index of partition rel for this level */
List *pruning_steps; /* List of PartitionPruneStep, see below */
Bitmapset *present_parts; /* Indexes of all partitions which subplans or
* subparts are present for. */