forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit658d391
committed
Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS.
LIKE INCLUDING DEFAULTS tried to copy the attrdef expression withoutcopying the state of the attgenerated column. This is in fact wrong,because GENERATED and DEFAULT expressions are not the same kind of animal;one can contain Vars and the other not. We *must* copy attgeneratedwhen we're copying the attrdef expression. Rearrange the if-testsso that the expression is copied only when the correct one ofINCLUDING DEFAULTS and INCLUDING GENERATED has been specified.Per private report from Manuel Rigger.Tom Lane and Peter Eisentraut1 parent37ad126 commit658d391
File tree
3 files changed
+100
-6
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+100
-6
lines changedLines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1023 | 1023 |
| |
1024 | 1024 |
| |
1025 | 1025 |
| |
1026 |
| - | |
| 1026 | + | |
| 1027 | + | |
1027 | 1028 |
| |
1028 | 1029 |
| |
1029 |
| - | |
1030 |
| - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1031 | 1033 |
| |
1032 | 1034 |
| |
1033 | 1035 |
| |
| |||
1065 | 1067 |
| |
1066 | 1068 |
| |
1067 | 1069 |
| |
1068 |
| - | |
1069 |
| - | |
1070 |
| - | |
| 1070 | + | |
1071 | 1071 |
| |
1072 | 1072 |
| |
1073 | 1073 |
| |
|
Lines changed: 74 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
162 | 236 |
| |
163 | 237 |
| |
164 | 238 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
68 | 88 |
| |
69 | 89 |
| |
70 | 90 |
| |
|
0 commit comments
Comments
(0)