forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit91e16b9
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 parent4c8aa8b commit91e16b9
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 | |
---|---|---|---|
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
177 |
| - | |
178 |
| - | |
179 |
| - | |
180 |
| - | |
181 |
| - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
182 | 185 |
| |
183 | 186 |
| |
184 | 187 |
| |
| |||
229 | 232 |
| |
230 | 233 |
| |
231 | 234 |
| |
| 235 | + | |
| 236 | + | |
| 237 | + | |
232 | 238 |
| |
233 | 239 |
| |
234 | 240 |
| |
| |||
306 | 312 |
| |
307 | 313 |
| |
308 | 314 |
| |
309 |
| - | |
| 315 | + | |
| 316 | + | |
310 | 317 |
| |
311 | 318 |
| |
312 | 319 |
| |
| |||
2726 | 2733 |
| |
2727 | 2734 |
| |
2728 | 2735 |
| |
2729 |
| - | |
| 2736 | + | |
2730 | 2737 |
| |
2731 | 2738 |
| |
2732 | 2739 |
| |
| |||
2860 | 2867 |
| |
2861 | 2868 |
| |
2862 | 2869 |
| |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
2863 | 2873 |
| |
2864 | 2874 |
| |
2865 |
| - | |
| 2875 | + | |
2866 | 2876 |
| |
2867 | 2877 |
| |
2868 | 2878 |
| |
| |||
2874 | 2884 |
| |
2875 | 2885 |
| |
2876 | 2886 |
| |
2877 |
| - | |
| 2887 | + | |
2878 | 2888 |
| |
2879 | 2889 |
| |
2880 | 2890 |
| |
| |||
2954 | 2964 |
| |
2955 | 2965 |
| |
2956 | 2966 |
| |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2957 | 2970 |
| |
2958 | 2971 |
| |
2959 | 2972 |
| |
| |||
2983 | 2996 |
| |
2984 | 2997 |
| |
2985 | 2998 |
| |
| 2999 | + | |
2986 | 3000 |
| |
2987 | 3001 |
| |
2988 | 3002 |
| |
| |||
3002 | 3016 |
| |
3003 | 3017 |
| |
3004 | 3018 |
| |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
3005 | 3023 |
| |
3006 |
| - | |
3007 |
| - | |
| 3024 | + | |
| 3025 | + | |
3008 | 3026 |
| |
3009 | 3027 |
| |
3010 | 3028 |
| |
| |||
3471 | 3489 |
| |
3472 | 3490 |
| |
3473 | 3491 |
| |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
3474 | 3501 |
| |
3475 | 3502 |
| |
3476 | 3503 |
| |
|
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)