diff options
Diffstat (limited to 'src/include/nodes')
-rw-r--r-- | src/include/nodes/execnodes.h | 9 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 13 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 3fe16bd0983..8c8742e286e 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.194 2008/10/31 19:37:56 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.195 2008/11/15 19:43:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -368,14 +368,19 @@ typedef struct EState } EState; -/* es_rowMarks is a list of these structs: */ +/* + * es_rowMarks is a list of these structs. See RowMarkClause for details + * about rti and prti. toidAttno is not used in a "plain" rowmark. + */ typedef struct ExecRowMark { Relation relation; /* opened and RowShareLock'd relation */ Index rti; /* its range table index */ + Index prti; /* parent range table index, if child */ bool forUpdate; /* true = FOR UPDATE, false = FOR SHARE */ bool noWait; /* NOWAIT option */ AttrNumber ctidAttNo; /* resno of its ctid junk attribute */ + AttrNumber toidAttNo; /* resno of tableoid junk attribute, if any */ } ExecRowMark; diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 5e112d178ba..1edd094dbf6 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.377 2008/10/31 08:39:22 heikki Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.378 2008/11/15 19:43:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -700,14 +700,23 @@ typedef struct SortGroupClause * RowMarkClause - * representation of FOR UPDATE/SHARE clauses * - * We create a separate RowMarkClause node for each target relation + * We create a separate RowMarkClause node for each target relation. In the + * output of the parser and rewriter, all RowMarkClauses have rti == prti and + * isParent == false. When the planner discovers that a target relation + * is the root of an inheritance tree, it sets isParent true, and adds an + * additional RowMarkClause to the list for each child relation (including + * the target rel itself in its role as a child). The child entries have + * rti == child rel's RT index, prti == parent's RT index, and can therefore + * be recognized as children by the fact that prti != rti. */ typedef struct RowMarkClause { NodeTag type; Index rti; /* range table index of target relation */ + Index prti; /* range table index of parent relation */ bool forUpdate; /* true = FOR UPDATE, false = FOR SHARE */ bool noWait; /* NOWAIT option */ + bool isParent; /* set by planner when expanding inheritance */ } RowMarkClause; /* |