- Notifications
You must be signed in to change notification settings - Fork5
Commita051ef6
committed
Remove collation information from TypeName, where it does not belong.
The initial collations patch treated a COLLATE spec as part of a TypeName,following what can only be described as brain fade on the part of the SQLcommittee. It's a lot more reasonable to treat COLLATE as a syntacticallyseparate object, so that it can be added in only the productions where itactually belongs, rather than needing to reject it in a boatload of placeswhere it doesn't belong (something the original patch mostly failed to do).In addition this change lets us meet the spec's requirement to allowCOLLATE anywhere in the clauses of a ColumnDef, and it avoids unfriendlybehavior for constructs such as "foo::type COLLATE collation".To do this, pull collation information out of TypeName and put it inColumnDef instead, thus reverting most of the collation-related changes inparse_type.c's API. I made one additional structural change, which was touse a ColumnDef as an intermediate node in AT_AlterColumnType AlterTableCmdnodes. This provides enough room to get rid of the "transform" wart inAlterTableCmd too, since the ColumnDef can carry the USING expressioneasily enough.Also fix some other minor bugs that have crept in in the same areas,like failure to copy recently-added fields of ColumnDef in copyfuncs.c.While at it, document the formerly secret ability to specify a collationin ALTER TABLE ALTER COLUMN TYPE, ALTER TYPE ADD ATTRIBUTE, andALTER TYPE ALTER ATTRIBUTE TYPE; and correct some misstatements aboutwhat the default collation selection will be when COLLATE is omitted.BTW, the three-parameter form of format_type() should go away too,since it just contributes to the confusion in this area; but I'll dothat in a separate patch.1 parent01752f7 commita051ef6
File tree
28 files changed
+412
-246
lines changed- doc/src/sgml/ref
- src
- backend
- access/common
- commands
- nodes
- parser
- utils/adt
- include
- nodes
- parser
- pl/plpgsql/src
- test/regress/expected
28 files changed
+412
-246
lines changedLines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
118 |
| - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 |
| |
120 | 124 |
| |
121 | 125 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
93 |
| - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
94 | 95 |
| |
95 | 96 |
| |
96 | 97 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
248 | 248 |
| |
249 | 249 |
| |
250 | 250 |
| |
251 |
| - | |
252 |
| - | |
253 |
| - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
559 | 559 |
| |
560 | 560 |
| |
561 | 561 |
| |
562 |
| - | |
| 562 | + | |
| 563 | + | |
563 | 564 |
| |
564 | 565 |
| |
565 | 566 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
| 101 | + | |
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
210 |
| - | |
| 210 | + | |
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
|
Lines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
| 142 | + | |
142 | 143 |
| |
143 | 144 |
| |
144 | 145 |
| |
| 146 | + | |
| 147 | + | |
145 | 148 |
| |
146 | 149 |
| |
147 | 150 |
| |
148 | 151 |
| |
149 | 152 |
| |
150 | 153 |
| |
151 | 154 |
| |
152 |
| - | |
| 155 | + | |
153 | 156 |
| |
154 | 157 |
| |
155 | 158 |
| |
156 | 159 |
| |
157 | 160 |
| |
158 |
| - | |
| 161 | + | |
159 | 162 |
| |
160 | 163 |
| |
161 | 164 |
| |
162 | 165 |
| |
163 |
| - | |
| 166 | + | |
164 | 167 |
| |
165 | 168 |
| |
166 | 169 |
| |
167 | 170 |
| |
168 |
| - | |
| 171 | + | |
169 | 172 |
| |
170 | 173 |
| |
171 | 174 |
| |
172 | 175 |
| |
173 |
| - | |
| 176 | + | |
174 | 177 |
| |
175 | 178 |
| |
176 | 179 |
| |
177 | 180 |
| |
178 |
| - | |
| 181 | + | |
179 | 182 |
| |
180 | 183 |
| |
181 | 184 |
| |
182 | 185 |
| |
183 |
| - | |
| 186 | + | |
184 | 187 |
| |
185 | 188 |
| |
186 | 189 |
| |
187 | 190 |
| |
188 |
| - | |
| 191 | + | |
189 | 192 |
| |
190 | 193 |
| |
191 | 194 |
| |
192 | 195 |
| |
193 |
| - | |
| 196 | + | |
194 | 197 |
| |
195 | 198 |
| |
196 | 199 |
| |
197 | 200 |
| |
198 |
| - | |
| 201 | + | |
199 | 202 |
| |
200 | 203 |
| |
201 | 204 |
| |
|
Lines changed: 39 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
342 |
| - | |
| 342 | + | |
343 | 343 |
| |
344 | 344 |
| |
345 | 345 |
| |
| |||
1433 | 1433 |
| |
1434 | 1434 |
| |
1435 | 1435 |
| |
1436 |
| - | |
| 1436 | + | |
1437 | 1437 |
| |
1438 | 1438 |
| |
1439 | 1439 |
| |
| |||
1443 | 1443 |
| |
1444 | 1444 |
| |
1445 | 1445 |
| |
| 1446 | + | |
1446 | 1447 |
| |
1447 | 1448 |
| |
1448 | 1449 |
| |
| |||
1478 | 1479 |
| |
1479 | 1480 |
| |
1480 | 1481 |
| |
1481 |
| - | |
1482 |
| - | |
| 1482 | + | |
1483 | 1483 |
| |
1484 | 1484 |
| |
1485 | 1485 |
| |
| 1486 | + | |
1486 | 1487 |
| |
1487 | 1488 |
| |
1488 | 1489 |
| |
| 1490 | + | |
| 1491 | + | |
1489 | 1492 |
| |
1490 | 1493 |
| |
1491 | 1494 |
| |
| |||
1616 | 1619 |
| |
1617 | 1620 |
| |
1618 | 1621 |
| |
1619 |
| - | |
1620 |
| - | |
| 1622 | + | |
| 1623 | + | |
1621 | 1624 |
| |
1622 | 1625 |
| |
1623 | 1626 |
| |
| |||
1626 | 1629 |
| |
1627 | 1630 |
| |
1628 | 1631 |
| |
| 1632 | + | |
| 1633 | + | |
1629 | 1634 |
| |
1630 | 1635 |
| |
1631 | 1636 |
| |
| |||
3092 | 3097 |
| |
3093 | 3098 |
| |
3094 | 3099 |
| |
3095 |
| - | |
| 3100 | + | |
3096 | 3101 |
| |
3097 | 3102 |
| |
3098 | 3103 |
| |
| |||
4129 | 4134 |
| |
4130 | 4135 |
| |
4131 | 4136 |
| |
4132 |
| - | |
| 4137 | + | |
4133 | 4138 |
| |
4134 | 4139 |
| |
4135 | 4140 |
| |
4136 | 4141 |
| |
4137 | 4142 |
| |
4138 | 4143 |
| |
| 4144 | + | |
4139 | 4145 |
| |
4140 | 4146 |
| |
4141 | 4147 |
| |
| |||
4201 | 4207 |
| |
4202 | 4208 |
| |
4203 | 4209 |
| |
4204 |
| - | |
| 4210 | + | |
4205 | 4211 |
| |
4206 | 4212 |
| |
| 4213 | + | |
4207 | 4214 |
| |
4208 | 4215 |
| |
4209 | 4216 |
| |
| |||
4413 | 4420 |
| |
4414 | 4421 |
| |
4415 | 4422 |
| |
4416 |
| - | |
| 4423 | + | |
4417 | 4424 |
| |
4418 | 4425 |
| |
4419 | 4426 |
| |
| |||
6471 | 6478 |
| |
6472 | 6479 |
| |
6473 | 6480 |
| |
6474 |
| - | |
| 6481 | + | |
| 6482 | + | |
| 6483 | + | |
6475 | 6484 |
| |
6476 | 6485 |
| |
6477 | 6486 |
| |
6478 | 6487 |
| |
6479 | 6488 |
| |
6480 | 6489 |
| |
6481 |
| - | |
6482 | 6490 |
| |
6483 | 6491 |
| |
6484 | 6492 |
| |
| |||
6512 | 6520 |
| |
6513 | 6521 |
| |
6514 | 6522 |
| |
6515 |
| - | |
| 6523 | + | |
| 6524 | + | |
| 6525 | + | |
| 6526 | + | |
6516 | 6527 |
| |
6517 | 6528 |
| |
6518 | 6529 |
| |
| |||
6527 | 6538 |
| |
6528 | 6539 |
| |
6529 | 6540 |
| |
6530 |
| - | |
| 6541 | + | |
6531 | 6542 |
| |
6532 | 6543 |
| |
6533 | 6544 |
| |
| |||
6539 | 6550 |
| |
6540 | 6551 |
| |
6541 | 6552 |
| |
6542 |
| - | |
| 6553 | + | |
6543 | 6554 |
| |
6544 | 6555 |
| |
6545 | 6556 |
| |
| |||
6592 | 6603 |
| |
6593 | 6604 |
| |
6594 | 6605 |
| |
6595 |
| - | |
6596 |
| - | |
6597 |
| - | |
6598 |
| - | |
6599 |
| - | |
6600 |
| - | |
6601 |
| - | |
| 6606 | + | |
| 6607 | + | |
| 6608 | + | |
| 6609 | + | |
6602 | 6610 |
| |
6603 |
| - | |
6604 |
| - | |
| 6611 | + | |
| 6612 | + | |
6605 | 6613 |
| |
6606 | 6614 |
| |
6607 | 6615 |
| |
| |||
6667 | 6675 |
| |
6668 | 6676 |
| |
6669 | 6677 |
| |
6670 |
| - | |
| 6678 | + | |
6671 | 6679 |
| |
| 6680 | + | |
| 6681 | + | |
| 6682 | + | |
6672 | 6683 |
| |
6673 | 6684 |
| |
6674 | 6685 |
| |
| |||
6705 | 6716 |
| |
6706 | 6717 |
| |
6707 | 6718 |
| |
6708 |
| - | |
| 6719 | + | |
6709 | 6720 |
| |
6710 | 6721 |
| |
| 6722 | + | |
| 6723 | + | |
6711 | 6724 |
| |
6712 | 6725 |
| |
6713 | 6726 |
| |
|
0 commit comments
Comments
(0)