- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5e1963f
committed
Collations with nondeterministic comparison
This adds a flag "deterministic" to collations. If that is false,such a collation disables various optimizations that assume thatstrings are equal only if they are byte-wise equal. That then allowsuse cases such as case-insensitive or accent-insensitive comparisonsor handling of strings with different Unicode normal forms.This functionality is only supported with the ICU provider. At leastglibc doesn't appear to have any locales that work in anondeterministic way, so it's not worth supporting this for the libcprovider.The term "deterministic comparison" in this context is from UnicodeTechnical Standard#10(https://unicode.org/reports/tr10/#Deterministic_Comparison).This patch makes changes in three areas:- CREATE COLLATION DDL changes and system catalog changes to support this new flag.- Many executor nodes and auxiliary code are extended to track collations. Previously, this code would just throw away collation information, because the eventually-called user-defined functions didn't use it since they only cared about equality, which didn't need collation information.- String data type functions that do equality comparisons and hashing are changed to take the (non-)deterministic flag into account. For comparison, this just means skipping various shortcuts and tie breakers that use byte-wise comparison. For hashing, we first need to convert the input string to a canonical "sort key" using the ICU analogue of strxfrm().Reviewed-by: Daniel Verite <daniel@manitou-mail.org>Reviewed-by: Peter Geoghegan <pg@bowt.ie>Discussion:https://www.postgresql.org/message-id/flat/1ccc668f-4cbc-0bef-af67-450b47cdfee7@2ndquadrant.com1 parent2ab6d28 commit5e1963f
File tree
69 files changed
+2087
-239
lines changed- contrib/bloom
- doc/src/sgml
- ref
- src
- backend
- access
- hash
- spgist
- catalog
- commands
- executor
- nodes
- optimizer
- plan
- util
- partitioning
- regex
- utils
- adt
- cache
- bin
- initdb
- pg_dump
- psql
- include
- catalog
- executor
- nodes
- optimizer
- partitioning
- utils
- test
- regress
- expected
- sql
- subscription
- t
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
69 files changed
+2087
-239
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
| 140 | + | |
140 | 141 |
| |
141 | 142 |
| |
142 | 143 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
| |||
267 | 268 |
| |
268 | 269 |
| |
269 | 270 |
| |
270 |
| - | |
| 271 | + | |
271 | 272 |
| |
272 | 273 |
| |
273 | 274 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2077 | 2077 |
| |
2078 | 2078 |
| |
2079 | 2079 |
| |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
2080 | 2087 |
| |
2081 | 2088 |
| |
2082 | 2089 |
| |
|
Lines changed: 56 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
847 | 847 |
| |
848 | 848 |
| |
849 | 849 |
| |
850 |
| - | |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
855 | 857 |
| |
856 | 858 |
| |
857 | 859 |
| |
| |||
883 | 885 |
| |
884 | 886 |
| |
885 | 887 |
| |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
886 | 937 |
| |
887 | 938 |
| |
888 | 939 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 |
| |
18 | 28 |
| |
19 | 29 |
| |
| |||
246 | 256 |
| |
247 | 257 |
| |
248 | 258 |
| |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
249 | 270 |
| |
250 | 271 |
| |
251 | 272 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4065 | 4065 |
| |
4066 | 4066 |
| |
4067 | 4067 |
| |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
4068 | 4074 |
| |
4069 | 4075 |
| |
4070 | 4076 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
124 | 125 |
| |
125 | 126 |
| |
126 | 127 |
| |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
127 | 149 |
| |
128 | 150 |
| |
129 | 151 |
| |
|
Lines changed: 89 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
| 33 | + | |
32 | 34 |
| |
33 | 35 |
| |
34 | 36 |
| |
| |||
243 | 245 |
| |
244 | 246 |
| |
245 | 247 |
| |
| 248 | + | |
| 249 | + | |
246 | 250 |
| |
247 | 251 |
| |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
255 | 293 |
| |
256 | 294 |
| |
257 | 295 |
| |
| |||
263 | 301 |
| |
264 | 302 |
| |
265 | 303 |
| |
| 304 | + | |
| 305 | + | |
266 | 306 |
| |
267 | 307 |
| |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
272 | 350 |
| |
273 | 351 |
| |
274 | 352 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
630 | 630 |
| |
631 | 631 |
| |
632 | 632 |
| |
633 |
| - | |
| 633 | + | |
| 634 | + | |
634 | 635 |
| |
635 | 636 |
| |
636 | 637 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| |||
160 | 161 |
| |
161 | 162 |
| |
162 | 163 |
| |
| 164 | + | |
163 | 165 |
| |
164 | 166 |
| |
165 | 167 |
| |
|
0 commit comments
Comments
(0)