1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

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.
This commit is contained in:
Tom Lane
2008-11-15 19:43:47 +00:00
parent 07c179a82b
commit 0656ed3daa
15 changed files with 150 additions and 41 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.176 2008/11/11 18:13:32 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.177 2008/11/15 19:43:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -283,17 +283,6 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
int nattrs;
ListCell *l;
/*
* XXX for now, can't handle inherited expansion of FOR UPDATE/SHARE; can
* we do better? (This will take some redesign because the executor
* currently supposes that every rowMark relation is involved in every row
* returned by the query.)
*/
if (get_rowmark(root->parse, parentRTindex))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("SELECT FOR UPDATE/SHARE is not supported for inheritance queries")));
/*
* Initialize to compute size estimates for whole append relation.
*