forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit27ff4cf
committed
Disallow LATERAL references to the target table of an UPDATE/DELETE.
On second thought, commit0c051c9 wasover-hasty: rather than allowing this case, we ought to reject it for now.That leaves the field clear for a future feature that allows the targettable to be re-specified in the FROM (or USING) clause, which will enableleft-joining the target table to something else. We can then also allowLATERAL references to such an explicitly re-specified target table.But allowing them right now will create ambiguities or worse for such afeature, and it isn't something we documented 9.3 as supporting.While at it, add a convenience subroutine to avoid having several copiesof the ereport for disalllowed-LATERAL-reference cases.1 parent5bfcc9e commit27ff4cf
File tree
5 files changed
+72
-66
lines changed- src
- backend/parser
- include/parser
- test/regress
- expected
- sql
5 files changed
+72
-66
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
370 |
| - | |
| 370 | + | |
371 | 371 |
| |
| 372 | + | |
372 | 373 |
| |
373 | 374 |
| |
374 | 375 |
| |
| |||
378 | 379 |
| |
379 | 380 |
| |
380 | 381 |
| |
381 |
| - | |
| 382 | + | |
382 | 383 |
| |
| 384 | + | |
383 | 385 |
| |
384 | 386 |
| |
385 | 387 |
| |
| |||
1925 | 1927 |
| |
1926 | 1928 |
| |
1927 | 1929 |
| |
1928 |
| - | |
| 1930 | + | |
1929 | 1931 |
| |
| 1932 | + | |
1930 | 1933 |
| |
1931 | 1934 |
| |
1932 | 1935 |
| |
1933 | 1936 |
| |
1934 | 1937 |
| |
1935 | 1938 |
| |
1936 | 1939 |
| |
1937 |
| - | |
| 1940 | + | |
1938 | 1941 |
| |
| 1942 | + | |
1939 | 1943 |
| |
1940 | 1944 |
| |
1941 | 1945 |
| |
|
Lines changed: 37 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
| 42 | + | |
41 | 43 |
| |
42 | 44 |
| |
43 | 45 |
| |
| |||
170 | 172 |
| |
171 | 173 |
| |
172 | 174 |
| |
173 |
| - | |
174 |
| - | |
175 |
| - | |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 |
| - | |
180 |
| - | |
| 175 | + | |
181 | 176 |
| |
182 | 177 |
| |
183 | 178 |
| |
| |||
221 | 216 |
| |
222 | 217 |
| |
223 | 218 |
| |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 |
| - | |
231 |
| - | |
| 219 | + | |
232 | 220 |
| |
233 | 221 |
| |
234 | 222 |
| |
| |||
410 | 398 |
| |
411 | 399 |
| |
412 | 400 |
| |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
413 | 432 |
| |
414 | 433 |
| |
415 | 434 |
| |
| |||
622 | 641 |
| |
623 | 642 |
| |
624 | 643 |
| |
625 |
| - | |
626 |
| - | |
627 |
| - | |
628 |
| - | |
629 |
| - | |
630 |
| - | |
631 |
| - | |
632 |
| - | |
633 |
| - | |
| 644 | + | |
| 645 | + | |
634 | 646 |
| |
635 | 647 |
| |
636 | 648 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
188 |
| - | |
| 188 | + | |
| 189 | + | |
189 | 190 |
| |
190 | 191 |
| |
191 | 192 |
| |
|
Lines changed: 19 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4057 | 4057 |
| |
4058 | 4058 |
| |
4059 | 4059 |
| |
4060 |
| - | |
4061 |
| - | |
4062 |
| - | |
4063 |
| - | |
4064 |
| - | |
4065 |
| - | |
4066 |
| - | |
4067 |
| - | |
4068 |
| - | |
4069 |
| - | |
4070 |
| - | |
| 4060 | + | |
4071 | 4061 |
| |
4072 | 4062 |
| |
4073 | 4063 |
| |
| |||
4078 | 4068 |
| |
4079 | 4069 |
| |
4080 | 4070 |
| |
4081 |
| - | |
| 4071 | + | |
4082 | 4072 |
| |
4083 |
| - | |
4084 |
| - | |
4085 |
| - | |
4086 |
| - | |
4087 |
| - | |
4088 |
| - | |
4089 |
| - | |
4090 |
| - | |
4091 |
| - | |
4092 |
| - | |
4093 |
| - | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
4094 | 4081 |
| |
4095 | 4082 |
| |
4096 | 4083 |
| |
4097 | 4084 |
| |
4098 | 4085 |
| |
4099 |
| - | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
4100 | 4091 |
| |
4101 |
| - | |
4102 |
| - | |
4103 |
| - | |
4104 |
| - | |
4105 |
| - | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + |
Lines changed: 6 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1137 | 1137 |
| |
1138 | 1138 |
| |
1139 | 1139 |
| |
1140 |
| - | |
1141 | 1140 |
| |
1142 |
| - | |
| 1141 | + | |
1143 | 1142 |
| |
1144 | 1143 |
| |
1145 |
| - | |
| 1144 | + | |
1146 | 1145 |
| |
1147 |
| - | |
| 1146 | + | |
| 1147 | + | |
1148 | 1148 |
| |
1149 |
| - | |
| 1149 | + | |
1150 | 1150 |
| |
1151 |
| - | |
| 1151 | + | |
1152 | 1152 |
| |
1153 |
| - |
0 commit comments
Comments
(0)