- Notifications
You must be signed in to change notification settings - Fork28
Commit6b0faf7
committed
Make collation-aware system catalog columns use "C" collation.
Up to now we allowed text columns in system catalogs to use collation"default", but that isn't really safe because it might mean somethingdifferent in template0 than it means in a database cloned from template0.In particular, this could mean that cloned pg_statistic entries for suchcolumns weren't entirely valid, possibly leading to bogus plannerestimates, though (probably) not any outright failures.In the wake of commit5e09280, a better solution is available: if welabel such columns with "C" collation, then their pg_statistic entrieswill also use that collation and hence will be valid independently ofthe database collation.This also provides a cleaner solution for indexes on such columns thanthe hack added by commit0b28ea7: the indexes will naturally inherit"C" collation and don't have to be forced to use text_pattern_ops.Also, with the planned improvement of type "name" to be collation-aware,this policy will apply cleanly to both text and name columns.Because of the pg_statistic angle, we should also apply this policyto the tables in information_schema. This patch does that by adjustinginformation_schema's textual domain types to specify "C" collation.That has the user-visible effect that order-sensitive comparisons totextual information_schema view columns will now use "C" collationby default. The SQL standard says that the collation of those viewcolumns is implementation-defined, so I think this is legal per spec.At some point this might allow for translation of such comparisonsinto indexable conditions on the underlying "name" columns, althoughadditional work will be needed before that can happen.Discussion:https://postgr.es/m/19346.1544895309@sss.pgh.pa.us1 parentb2d9e17 commit6b0faf7
File tree
9 files changed
+60
-32
lines changed- src
- backend
- access/common
- bootstrap
- catalog
- utils/cache
- include/catalog
- test/regress
- expected
- sql
9 files changed
+60
-32
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
| 86 | + | |
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
744 | 744 |
| |
745 | 745 |
| |
746 | 746 |
| |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
747 | 756 |
| |
748 | 757 |
| |
749 | 758 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
| 170 | + | |
| 171 | + | |
| 172 | + | |
170 | 173 |
| |
171 | 174 |
| |
172 | 175 |
| |
| |||
693 | 696 |
| |
694 | 697 |
| |
695 | 698 |
| |
696 |
| - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
697 | 703 |
| |
698 | 704 |
| |
699 | 705 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
208 | 208 |
| |
209 | 209 |
| |
210 | 210 |
| |
211 |
| - | |
| 211 | + | |
212 | 212 |
| |
213 | 213 |
| |
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
219 |
| - | |
| 219 | + | |
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
| |||
243 | 243 |
| |
244 | 244 |
| |
245 | 245 |
| |
246 |
| - | |
| 246 | + | |
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
|
Lines changed: 7 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
| |||
1014 | 1015 |
| |
1015 | 1016 |
| |
1016 | 1017 |
| |
1017 |
| - | |
1018 |
| - | |
| 1018 | + | |
| 1019 | + | |
1019 | 1020 |
| |
1020 | 1021 |
| |
1021 | 1022 |
| |
| |||
1961 | 1962 |
| |
1962 | 1963 |
| |
1963 | 1964 |
| |
1964 |
| - | |
1965 |
| - | |
1966 |
| - | |
1967 |
| - | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1968 | 1969 |
| |
1969 | 1970 |
| |
1970 | 1971 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
313 |
| - | |
| 313 | + | |
314 | 314 |
| |
315 | 315 |
| |
316 |
| - | |
| 316 | + | |
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
| |||
333 | 333 |
| |
334 | 334 |
| |
335 | 335 |
| |
336 |
| - | |
| 336 | + | |
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
|
Lines changed: 14 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2060 | 2060 |
| |
2061 | 2061 |
| |
2062 | 2062 |
| |
2063 |
| - | |
2064 |
| - | |
2065 |
| - | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
2066 | 2075 |
| |
2067 | 2076 |
| |
2068 | 2077 |
| |
2069 | 2078 |
| |
2070 | 2079 |
| |
2071 |
| - | |
2072 |
| - | |
2073 |
| - | |
2074 |
| - | |
| 2080 | + | |
| 2081 | + | |
2075 | 2082 |
| |
2076 | 2083 |
| |
2077 | 2084 |
| |
|
Lines changed: 12 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1333 | 1333 |
| |
1334 | 1334 |
| |
1335 | 1335 |
| |
1336 |
| - | |
1337 |
| - | |
1338 |
| - | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1339 | 1346 |
| |
1340 | 1347 |
| |
1341 | 1348 |
| |
1342 | 1349 |
| |
1343 | 1350 |
| |
1344 | 1351 |
| |
1345 |
| - | |
1346 |
| - | |
1347 |
| - | |
1348 |
| - | |
| 1352 | + | |
| 1353 | + |
0 commit comments
Comments
(0)