summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepjointree.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-30 18:30:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-30 18:30:40 +0000
commit986085a7f08c72219abf47f8b968213e81ab943c (patch)
treea80d30e59cffd042ed9adb024afc5f5d6bf00e16 /src/backend/optimizer/prep/prepjointree.c
parent931bfc96644b8f51a49161f780d43506e55d2b13 (diff)
Improve the representation of FOR UPDATE/FOR SHARE so that we can
support both FOR UPDATE and FOR SHARE in one command, as well as both NOWAIT and normal WAIT behavior. The more general code is actually simpler and cleaner.
Diffstat (limited to 'src/backend/optimizer/prep/prepjointree.c')
-rw-r--r--src/backend/optimizer/prep/prepjointree.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c
index ae538c9cc00..f3b6df46f21 100644
--- a/src/backend/optimizer/prep/prepjointree.c
+++ b/src/backend/optimizer/prep/prepjointree.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.37 2006/03/07 01:00:15 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.38 2006/04/30 18:30:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -409,29 +409,9 @@ pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte,
/*
* Pull up any FOR UPDATE/SHARE markers, too. (OffsetVarNodes
- * already adjusted the marker values, so just list_concat the
- * list.)
- *
- * Executor can't handle multiple FOR UPDATE/SHARE/NOWAIT flags,
- * so complain if they are valid but different
+ * already adjusted the marker rtindexes, so just concat the lists.)
*/
- if (parse->rowMarks && subquery->rowMarks)
- {
- if (parse->forUpdate != subquery->forUpdate)
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot use both FOR UPDATE and FOR SHARE in one query")));
- if (parse->rowNoWait != subquery->rowNoWait)
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot use both wait and NOWAIT in one query")));
- }
parse->rowMarks = list_concat(parse->rowMarks, subquery->rowMarks);
- if (subquery->rowMarks)
- {
- parse->forUpdate = subquery->forUpdate;
- parse->rowNoWait = subquery->rowNoWait;
- }
/*
* We also have to fix the relid sets of any parent InClauseInfo