pgsql: Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having

Started by Tom Laneover 17 years ago2 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having the plan
return the tableoid as well as the ctid for any FOR UPDATE targets that
have child tables. All child tables are listed in the ExecRowMark list,
but the executor just skips the ones that didn't produce the current row.

Curiously, this longstanding restriction doesn't seem to have been documented
anywhere; so no doc changes.

Modified Files:
--------------
pgsql/src/backend/executor:
execMain.c (r1.315 -> r1.316)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execMain.c?r1=1.315&r2=1.316)
pgsql/src/backend/nodes:
copyfuncs.c (r1.411 -> r1.412)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.411&r2=1.412)
equalfuncs.c (r1.336 -> r1.337)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.336&r2=1.337)
outfuncs.c (r1.344 -> r1.345)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.344&r2=1.345)
readfuncs.c (r1.216 -> r1.217)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c?r1=1.216&r2=1.217)
pgsql/src/backend/optimizer/path:
allpaths.c (r1.176 -> r1.177)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/allpaths.c?r1=1.176&r2=1.177)
pgsql/src/backend/optimizer/prep:
preptlist.c (r1.93 -> r1.94)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/preptlist.c?r1=1.93&r2=1.94)
prepunion.c (r1.161 -> r1.162)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.161&r2=1.162)
pgsql/src/backend/parser:
analyze.c (r1.382 -> r1.383)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c?r1=1.382&r2=1.383)
pgsql/src/backend/rewrite:
rewriteManip.c (r1.117 -> r1.118)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteManip.c?r1=1.117&r2=1.118)
pgsql/src/include/catalog:
catversion.h (r1.507 -> r1.508)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.507&r2=1.508)
pgsql/src/include/nodes:
execnodes.h (r1.194 -> r1.195)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h?r1=1.194&r2=1.195)
parsenodes.h (r1.377 -> r1.378)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h?r1=1.377&r2=1.378)
pgsql/src/test/regress/expected:
portals.out (r1.17 -> r1.18)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/portals.out?r1=1.17&r2=1.18)
pgsql/src/test/regress/sql:
portals.sql (r1.14 -> r1.15)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/portals.sql?r1=1.14&r2=1.15)

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql: Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having

Tom Lane wrote:

Log Message:
-----------
Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having the plan
return the tableoid as well as the ctid for any FOR UPDATE targets that
have child tables. All child tables are listed in the ExecRowMark list,
but the executor just skips the ones that didn't produce the current row.

Curiously, this longstanding restriction doesn't seem to have been documented
anywhere; so no doc changes.

It was documented on the TODO list; marked as done now.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +