forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite92e4a2
committed
Fix CREATE TABLE LIKE INCLUDING GENERATED column order issue
CREATE TABLE LIKE INCLUDING GENERATED would fail if a generated columnreferred to a column with a higher attribute number. This is becausethe column mapping mechanism created the mapping incrementally ascolumns are added. This was sufficient for previous uses of thatmechanism (omitting dropped columns), and it also happened to work ifgenerated columns only referred to columns with lower attributenumbers, but here it failed.This fix is to build the attribute mapping in a separate loop beforeprocessing the columns in detail.Bug: #16342Reported-by: Ethan Waldo <ewaldo@healthetechs.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>1 parentc4f82a7 commite92e4a2
File tree
3 files changed
+47
-26
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+47
-26
lines changedLines changed: 22 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
924 | 924 |
| |
925 | 925 |
| |
926 | 926 |
| |
| 927 | + | |
927 | 928 |
| |
928 | 929 |
| |
929 | 930 |
| |
| |||
986 | 987 |
| |
987 | 988 |
| |
988 | 989 |
| |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
989 | 1010 |
| |
990 | 1011 |
| |
991 | 1012 |
| |
| |||
998 | 1019 |
| |
999 | 1020 |
| |
1000 | 1021 |
| |
1001 |
| - | |
| 1022 | + | |
1002 | 1023 |
| |
1003 | 1024 |
| |
1004 | 1025 |
| |
| |||
1030 | 1051 |
| |
1031 | 1052 |
| |
1032 | 1053 |
| |
1033 |
| - | |
1034 |
| - | |
1035 | 1054 |
| |
1036 | 1055 |
| |
1037 | 1056 |
| |
|
Lines changed: 15 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 |
| - | |
| 162 | + | |
| 163 | + | |
163 | 164 |
| |
164 | 165 |
| |
165 | 166 |
| |
166 | 167 |
| |
167 |
| - | |
168 | 168 |
| |
169 | 169 |
| |
| 170 | + | |
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
| |||
176 | 177 |
| |
177 | 178 |
| |
178 | 179 |
| |
179 |
| - | |
180 | 180 |
| |
181 | 181 |
| |
| 182 | + | |
182 | 183 |
| |
183 |
| - | |
184 |
| - | |
| 184 | + | |
| 185 | + | |
185 | 186 |
| |
186 | 187 |
| |
187 | 188 |
| |
| |||
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
194 |
| - | |
195 | 195 |
| |
196 | 196 |
| |
| 197 | + | |
197 | 198 |
| |
198 |
| - | |
199 |
| - | |
| 199 | + | |
| 200 | + | |
200 | 201 |
| |
201 | 202 |
| |
202 | 203 |
| |
| |||
206 | 207 |
| |
207 | 208 |
| |
208 | 209 |
| |
209 |
| - | |
210 | 210 |
| |
211 | 211 |
| |
| 212 | + | |
212 | 213 |
| |
213 |
| - | |
214 |
| - | |
| 214 | + | |
| 215 | + | |
215 | 216 |
| |
216 | 217 |
| |
217 | 218 |
| |
| |||
221 | 222 |
| |
222 | 223 |
| |
223 | 224 |
| |
224 |
| - | |
225 | 225 |
| |
226 | 226 |
| |
| 227 | + | |
227 | 228 |
| |
228 |
| - | |
229 |
| - | |
| 229 | + | |
| 230 | + | |
230 | 231 |
| |
231 | 232 |
| |
232 | 233 |
| |
|
Lines changed: 10 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
68 |
| - | |
| 68 | + | |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
75 |
| - | |
76 |
| - | |
| 76 | + | |
| 77 | + | |
77 | 78 |
| |
78 |
| - | |
79 |
| - | |
| 79 | + | |
| 80 | + | |
80 | 81 |
| |
81 |
| - | |
82 |
| - | |
| 82 | + | |
| 83 | + | |
83 | 84 |
| |
84 |
| - | |
85 |
| - | |
| 85 | + | |
| 86 | + | |
86 | 87 |
| |
87 | 88 |
| |
88 | 89 |
| |
|
0 commit comments
Comments
(0)