- Notifications
You must be signed in to change notification settings - Fork5
Commit158b7fa
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 parent910bac5 commit158b7fa
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 | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
40 | 42 |
| |
41 | 43 |
| |
42 | 44 |
| |
| |||
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 |
| |
| |||
632 | 651 |
| |
633 | 652 |
| |
634 | 653 |
| |
635 |
| - | |
636 |
| - | |
637 |
| - | |
638 |
| - | |
639 |
| - | |
640 |
| - | |
641 |
| - | |
642 |
| - | |
643 |
| - | |
| 654 | + | |
| 655 | + | |
644 | 656 |
| |
645 | 657 |
| |
646 | 658 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
186 | 186 |
| |
187 | 187 |
| |
188 | 188 |
| |
189 |
| - | |
| 189 | + | |
| 190 | + | |
190 | 191 |
| |
191 | 192 |
| |
192 | 193 |
| |
|
Lines changed: 19 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4105 | 4105 |
| |
4106 | 4106 |
| |
4107 | 4107 |
| |
4108 |
| - | |
4109 |
| - | |
4110 |
| - | |
4111 |
| - | |
4112 |
| - | |
4113 |
| - | |
4114 |
| - | |
4115 |
| - | |
4116 |
| - | |
4117 |
| - | |
4118 |
| - | |
| 4108 | + | |
4119 | 4109 |
| |
4120 | 4110 |
| |
4121 | 4111 |
| |
| |||
4126 | 4116 |
| |
4127 | 4117 |
| |
4128 | 4118 |
| |
4129 |
| - | |
| 4119 | + | |
4130 | 4120 |
| |
4131 |
| - | |
4132 |
| - | |
4133 |
| - | |
4134 |
| - | |
4135 |
| - | |
4136 |
| - | |
4137 |
| - | |
4138 |
| - | |
4139 |
| - | |
4140 |
| - | |
4141 |
| - | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
4142 | 4129 |
| |
4143 | 4130 |
| |
4144 | 4131 |
| |
4145 | 4132 |
| |
4146 | 4133 |
| |
4147 |
| - | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
4148 | 4139 |
| |
4149 |
| - | |
4150 |
| - | |
4151 |
| - | |
4152 |
| - | |
4153 |
| - | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + |
Lines changed: 6 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1151 | 1151 |
| |
1152 | 1152 |
| |
1153 | 1153 |
| |
1154 |
| - | |
1155 | 1154 |
| |
1156 |
| - | |
| 1155 | + | |
1157 | 1156 |
| |
1158 | 1157 |
| |
1159 |
| - | |
| 1158 | + | |
1160 | 1159 |
| |
1161 |
| - | |
| 1160 | + | |
| 1161 | + | |
1162 | 1162 |
| |
1163 |
| - | |
| 1163 | + | |
1164 | 1164 |
| |
1165 |
| - | |
| 1165 | + | |
1166 | 1166 |
| |
1167 |
| - |
0 commit comments
Comments
(0)