Fix LATERAL references to target table of UPDATE/DELETE.
Tom Lane <tgl@sss.pgh.pa.us>
Fix LATERAL references to target table of UPDATE/DELETE. I failed to think much about UPDATE/DELETE when implementing LATERAL :-(. The implemented behavior ended up being that subqueries in the FROM or USING clause (respectively) could access the update/delete target table as though it were a lateral reference; which seems fine if they said LATERAL, but certainly ought to draw an error if they didn't. Fix it so you get a suitable error when you omit LATERAL. Per report from Emre Hasegeli.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/analyze.c | modified | +21 −0 |
| src/backend/parser/parse_clause.c | modified | +4 −0 |
| src/backend/parser/parse_relation.c | modified | +4 −0 |
| src/test/regress/expected/join.out | modified | +48 −0 |
| src/test/regress/sql/join.sql | modified | +18 −0 |