diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-12 18:10:51 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-12 18:10:51 +0000 |
| commit | 0adaf4cb312fe3eff83e786d6a0b53ae2cdc9302 (patch) | |
| tree | 177cf2ea668d6fcabbafc37db4741813ea3f685d /src/include/nodes/parsenodes.h | |
| parent | 05d249717d652f0b16960d8a58611e222f1f907b (diff) | |
| download | postgresql-0adaf4cb312fe3eff83e786d6a0b53ae2cdc9302.tar.gz | |
Move the handling of SELECT FOR UPDATE locking and rechecking out of
execMain.c and into a new plan node type LockRows. Like the recent change
to put table updating into a ModifyTable plan node, this increases planning
flexibility by allowing the operations to occur below the top level of the
plan tree. It's necessary in any case to restore the previous behavior of
having FOR UPDATE locking occur before ModifyTable does.
This partially refactors EvalPlanQual to allow multiple rows-under-test
to be inserted into the EPQ machinery before starting an EPQ test query.
That isn't sufficient to fix EPQ's general bogosity in the face of plans
that return multiple rows per test row, though. Since this patch is
mostly about getting some plan node infrastructure in place and not about
fixing ten-year-old bugs, I will leave EPQ improvements for another day.
Another behavioral change that we could now think about is doing FOR UPDATE
before LIMIT, but that too seems like it should be treated as a followon
patch.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
| -rw-r--r-- | src/include/nodes/parsenodes.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 5f0d763b68..757aebef1a 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.405 2009/10/07 22:14:26 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.406 2009/10/12 18:10:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -809,12 +809,15 @@ typedef struct WindowClause * 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. + * rowmarkId is a unique ID for the RowMarkClause across an entire query, + * and is assigned during planning; it's always zero upstream of the planner. */ typedef struct RowMarkClause { NodeTag type; Index rti; /* range table index of target relation */ Index prti; /* range table index of parent relation */ + Index rowmarkId; /* unique identifier assigned by planner */ bool forUpdate; /* true = FOR UPDATE, false = FOR SHARE */ bool noWait; /* NOWAIT option */ bool isParent; /* set by planner when expanding inheritance */ |
