forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite31193d
committed
Fix yet another corner case in dumping rules/views with USING clauses.
ruleutils.c tries to cope with additions/deletions/renamings of columns intables referenced by views, by means of adding machine-generated aliases tothe printed form of a view when needed to preserve the original semantics.A recent blog post by Marko Tiikkaja pointed out a case I'd missed though:if one input of a join with USING is itself a join, there is nothing tostop the user from adding a column of the same name as the USING column towhichever side of the sub-join didn't provide the USING column. And thenthere'll be an error when the view is re-parsed, since now the sub-joinexposes two columns matching the USING specification. We were catching alot of related cases, but not this one, so add some logic to cope with it.Back-patch to 9.3, which is the first release that makes any seriousattempt to cope with such cases (cf commit2ffa740 and follow-ons).1 parentb72e90b commite31193d
File tree
3 files changed
+90
-11
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+90
-11
lines changedLines changed: 38 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
175 |
| - | |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 |
| - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
180 | 183 |
| |
181 | 184 |
| |
182 | 185 |
| |
| |||
227 | 230 |
| |
228 | 231 |
| |
229 | 232 |
| |
| 233 | + | |
| 234 | + | |
| 235 | + | |
230 | 236 |
| |
231 | 237 |
| |
232 | 238 |
| |
| |||
304 | 310 |
| |
305 | 311 |
| |
306 | 312 |
| |
307 |
| - | |
| 313 | + | |
| 314 | + | |
308 | 315 |
| |
309 | 316 |
| |
310 | 317 |
| |
| |||
2579 | 2586 |
| |
2580 | 2587 |
| |
2581 | 2588 |
| |
2582 |
| - | |
| 2589 | + | |
2583 | 2590 |
| |
2584 | 2591 |
| |
2585 | 2592 |
| |
| |||
2713 | 2720 |
| |
2714 | 2721 |
| |
2715 | 2722 |
| |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
2716 | 2726 |
| |
2717 | 2727 |
| |
2718 |
| - | |
| 2728 | + | |
2719 | 2729 |
| |
2720 | 2730 |
| |
2721 | 2731 |
| |
| |||
2727 | 2737 |
| |
2728 | 2738 |
| |
2729 | 2739 |
| |
2730 |
| - | |
| 2740 | + | |
2731 | 2741 |
| |
2732 | 2742 |
| |
2733 | 2743 |
| |
| |||
2807 | 2817 |
| |
2808 | 2818 |
| |
2809 | 2819 |
| |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
2810 | 2823 |
| |
2811 | 2824 |
| |
2812 | 2825 |
| |
| |||
2836 | 2849 |
| |
2837 | 2850 |
| |
2838 | 2851 |
| |
| 2852 | + | |
2839 | 2853 |
| |
2840 | 2854 |
| |
2841 | 2855 |
| |
| |||
2855 | 2869 |
| |
2856 | 2870 |
| |
2857 | 2871 |
| |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
2858 | 2876 |
| |
2859 |
| - | |
2860 |
| - | |
| 2877 | + | |
| 2878 | + | |
2861 | 2879 |
| |
2862 | 2880 |
| |
2863 | 2881 |
| |
| |||
3324 | 3342 |
| |
3325 | 3343 |
| |
3326 | 3344 |
| |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
3327 | 3354 |
| |
3328 | 3355 |
| |
3329 | 3356 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1298 | 1298 |
| |
1299 | 1299 |
| |
1300 | 1300 |
| |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
1301 | 1335 |
| |
1302 | 1336 |
| |
1303 | 1337 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
417 | 417 |
| |
418 | 418 |
| |
419 | 419 |
| |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
420 | 438 |
| |
421 | 439 |
| |
422 | 440 |
| |
|
0 commit comments
Comments
(0)