]> granicus.if.org Git - postgresql/commit
Move the handling of SELECT FOR UPDATE locking and rechecking out of
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Oct 2009 18:10:51 +0000 (18:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Oct 2009 18:10:51 +0000 (18:10 +0000)
commit0adaf4cb312fe3eff83e786d6a0b53ae2cdc9302
tree177cf2ea668d6fcabbafc37db4741813ea3f685d
parent05d249717d652f0b16960d8a58611e222f1f907b
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.
32 files changed:
src/backend/commands/explain.c
src/backend/executor/Makefile
src/backend/executor/README
src/backend/executor/execAmi.c
src/backend/executor/execCurrent.c
src/backend/executor/execMain.c
src/backend/executor/execProcnode.c
src/backend/executor/execUtils.c
src/backend/executor/nodeLockRows.c [new file with mode: 0644]
src/backend/executor/nodeSubqueryscan.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/relnode.c
src/backend/parser/analyze.c
src/include/catalog/catversion.h
src/include/executor/executor.h
src/include/executor/nodeLockRows.h [new file with mode: 0644]
src/include/nodes/execnodes.h
src/include/nodes/nodes.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h
src/include/nodes/relation.h
src/include/optimizer/planmain.h