- Notifications
You must be signed in to change notification settings - Fork5
Commit2ffa740
committed
Fix ruleutils to cope with conflicts from adding/dropping/renaming columns.
In commit11e1318, we improved therule/view dumping code so that it would produce valid query representationseven if some of the tables involved in a query had been renamed since thequery was parsed. This patch extends that idea to fix problems that occurwhen individual columns are renamed, or added or dropped. As before, thecore of the fix is to assign unique new aliases when a name conflict hasbeen created. This is complicated by the JOIN USING feature, whichrequires the same column alias to be used in both input relations, but wecan handle that with a sufficiently complex approach to assigning aliases.A fortiori, this patch takes care of situations where the query didn't haveunique column names to begin with, such as in a recent complaint from BryanNuse. (Because of expansion of "SELECT *", re-parsing a dumped query canrequire column name uniqueness even though the original text did not.)1 parent7eb559a commit2ffa740
File tree
5 files changed
+1764
-254
lines changed- src
- backend
- commands
- utils/adt
- test/regress
- expected
- sql
5 files changed
+1764
-254
lines changedLines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
653 | 653 |
| |
654 | 654 |
| |
655 | 655 |
| |
656 |
| - | |
657 |
| - | |
658 |
| - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
659 | 659 |
| |
660 | 660 |
| |
661 | 661 |
| |
| |||
1954 | 1954 |
| |
1955 | 1955 |
| |
1956 | 1956 |
| |
| 1957 | + | |
| 1958 | + | |
1957 | 1959 |
| |
1958 | 1960 |
| |
1959 | 1961 |
| |
| |||
2026 | 2028 |
| |
2027 | 2029 |
| |
2028 | 2030 |
| |
2029 |
| - | |
2030 |
| - | |
| 2031 | + | |
2031 | 2032 |
| |
2032 | 2033 |
| |
2033 | 2034 |
| |
| |||
2036 | 2037 |
| |
2037 | 2038 |
| |
2038 | 2039 |
| |
2039 |
| - | |
2040 |
| - | |
| 2040 | + | |
2041 | 2041 |
| |
2042 | 2042 |
| |
2043 | 2043 |
| |
|
Lines changed: 3 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
888 | 888 |
| |
889 | 889 |
| |
890 | 890 |
| |
891 |
| - | |
892 |
| - | |
893 |
| - | |
| 891 | + | |
894 | 892 |
| |
895 | 893 |
| |
896 | 894 |
| |
| |||
2143 | 2141 |
| |
2144 | 2142 |
| |
2145 | 2143 |
| |
2146 |
| - | |
2147 |
| - | |
2148 |
| - | |
| 2144 | + | |
2149 | 2145 |
| |
2150 | 2146 |
| |
2151 | 2147 |
| |
| |||
2941 | 2937 |
| |
2942 | 2938 |
| |
2943 | 2939 |
| |
2944 |
| - | |
2945 |
| - | |
2946 |
| - | |
2947 | 2940 |
| |
2948 | 2941 |
| |
2949 |
| - | |
2950 |
| - | |
2951 |
| - | |
| 2942 | + | |
2952 | 2943 |
| |
2953 | 2944 |
| |
2954 | 2945 |
| |
|
0 commit comments
Comments
(0)