diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-05 22:00:46 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-05 22:00:46 +0000 |
commit | e4044ba2d7487839ae7113074a65f1457fda56d7 (patch) | |
tree | 5b4bdc8a14f8502cb11b70880c30d7a09b88e160 /src/backend/optimizer/plan/initsplan.c | |
parent | 622736aa4a834caf35867ab75d744dfd7d8f44f8 (diff) |
Fix for this problem:
regression=# select 1 from tenk1 ta cross join tenk1 tb for update;
ERROR: no relation entry for relid 3
7.3 said "SELECT FOR UPDATE cannot be applied to a join", which was better
but still wrong, considering that 7.2 took the query just fine. Fix by
making transformForUpdate() ignore JOIN and other special RTE types,
rather than trying to mark them FOR UPDATE. The actual error message now
only appears if you explicitly name the join in FOR UPDATE.
Diffstat (limited to 'src/backend/optimizer/plan/initsplan.c')
-rw-r--r-- | src/backend/optimizer/plan/initsplan.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c index eec153b70d3..58a9e16eb65 100644 --- a/src/backend/optimizer/plan/initsplan.c +++ b/src/backend/optimizer/plan/initsplan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.91 2003/09/25 06:58:00 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.92 2003/11/05 22:00:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -91,14 +91,6 @@ add_base_rels_to_query(Query *root, Node *jtnode) add_base_rels_to_query(root, j->larg); add_base_rels_to_query(root, j->rarg); - - /* - * Safety check: join RTEs should not be SELECT FOR UPDATE targets - */ - if (intMember(j->rtindex, root->rowMarks)) - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("SELECT FOR UPDATE cannot be applied to a join"))); } else elog(ERROR, "unrecognized node type: %d", |