Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26cb820

Browse files
committed
Improve some comments related to executor result relations.
es_leaf_result_relations doesn't exist; perhaps this was an old namefor es_tuple_routing_result_relations, or maybe this comment has goneunmaintained through multiple rounds of whacking the code around.Related comment in execnodes.h was both obsolete and ungrammatical.
1 parent48d818e commit26cb820

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

‎src/backend/executor/execMain.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,14 +1347,16 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
13471347
}
13481348

13491349
/*
1350-
*ExecGetTriggerResultRel
1351-
*
1352-
* Get a ResultRelInfo for a trigger target relation. Most of the time,
1353-
* triggers are fired on one of the result relations of the query, and so
1354-
* we can just return a member of the es_result_relations array, the
1355-
* es_root_result_relations array (if any), or the es_leaf_result_relations
1356-
* list (if any). (Note: in self-join situations there might be multiple
1357-
* members with the same OID; if so it doesn't matter which one we pick.)
1350+
* ExecGetTriggerResultRel
1351+
*Get a ResultRelInfo for a trigger target relation.
1352+
*
1353+
* Most of the time, triggers are fired on one of the result relations of the
1354+
* query, and so we can just return a member of the es_result_relations array,
1355+
* or the es_root_result_relations array (if any), or the
1356+
* es_tuple_routing_result_relations list (if any). (Note: in self-join
1357+
* situations there might be multiple members with the same OID; if so it
1358+
* doesn't matter which one we pick.)
1359+
*
13581360
* However, it is sometimes necessary to fire triggers on other relations;
13591361
* this happens mainly when an RI update trigger queues additional triggers
13601362
* on other relations, which will be processed in the context of the outer
@@ -1404,6 +1406,7 @@ ExecGetTriggerResultRel(EState *estate, Oid relid)
14041406
if (RelationGetRelid(rInfo->ri_RelationDesc)==relid)
14051407
returnrInfo;
14061408
}
1409+
14071410
/* Nope, but maybe we already made an extra ResultRelInfo for it */
14081411
foreach(l,estate->es_trig_target_relations)
14091412
{

‎src/include/nodes/execnodes.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,10 @@ typedef struct EState
508508
ResultRelInfo*es_result_relation_info;/* currently active array elt */
509509

510510
/*
511-
* Info about the target partitioned target table root(s) for
512-
* update/delete queries. They required only to fire any per-statement
513-
* triggers defined on the table. It exists separately from
514-
* es_result_relations, because partitioned tables don't appear in the
515-
* plan tree for the update/delete cases.
511+
* Info about the partition root table(s) for insert/update/delete queries
512+
* targeting partitioned tables. Only leaf partitions are mentioned in
513+
* es_result_relations, but we need access to the roots for firing
514+
* triggers and for runtime tuple routing.
516515
*/
517516
ResultRelInfo*es_root_result_relations;/* array of ResultRelInfos */
518517
intes_num_root_result_relations;/* length of the array */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp