Re: Built-in CTYPE provider
Peter Eisentraut <peter@eisentraut.org>
On 18.01.24 23:03, Jeff Davis wrote: > On Thu, 2024-01-18 at 13:53 +0100, Peter Eisentraut wrote: >> I think that would be a terrible direction to take, because it would >> regress the default sort order from "correct" to "useless". > > I don't agree that the current default is "correct". There are a lot of > ways it can be wrong: > > * the environment variables at initdb time don't reflect what the > users of the database actually want > * there are so many different users using so many different > applications connected to the database that no one "correct" sort order > exists > * libc has some implementation quirks > * the version of Unicode that libc is based on is not what you expect > * the version of libc is not what you expect These are arguments why the current defaults are not universally perfect, but I'd argue that they are still most often the right thing as the default. >> Aside from >> the overall message this sends about how PostgreSQL cares about >> locales >> and Unicode and such. > > Unicode is primarily about the semantics of characters and their > relationships. The patches I propose here do a great job of that. > > Collation (relationships between *strings*) is a part of Unicode, but > not the whole thing or even the main thing. I don't get this argument. Of course, people care about sorting and sort order. Whether you consider this part of Unicode or adjacent to it, people still want it. >> Maybe you don't intend for this to be the default provider? > > I am not proposing that this provider be the initdb-time default. ok >> But then >> who would really use it? I mean, sure, some people would, but how >> would >> you even explain, in practice, the particular niche of users or use >> cases? > > It's for users who want to respect Unicode support text from > international sources in their database; but are not experts on the > subject and don't know precisely what they want or understand the > consequences. If and when such users do notice a problem with the sort > order, they'd handle it at that time (perhaps with a COLLATE clause, or > sorting in the application). > Vision: > * ICU offers COLLATE UNICODE, locale tailoring, case-insensitive > matching, and customization with rules. It's the solution for > everything from "slightly more advanced" to "very advanced". I am astonished by this. In your world, do users not want their text data sorted? Do they not care what the sort order is? You consider UCA sort order an "advanced" feature?
Commits
-
Support PG_UNICODE_FAST locale in the builtin collation provider.
- d3d098316913 18.0 landed
-
Support Unicode full case mapping and conversion.
- 286a365b9c25 18.0 landed
-
Fix test failures when language environment is not UTF-8.
- e2a235767180 17.0 landed
-
Add unicode_strtitle() for Unicode Default Case Conversion.
- 46e5441fa536 17.0 landed
-
Use version for builtin collations.
- 46a44dc37203 17.0 landed
-
Fix convert_case(), introduced in 5c40364dd6.
- 503c0ad976f5 17.0 landed
-
Inline basic UTF-8 functions.
- 9acae56ce0b0 17.0 landed
-
Support C.UTF-8 locale in the new builtin collation provider.
- f69319f2f1fb 17.0 landed
-
Fix another warning, introduced by 846311051e.
- 60769c62dc85 17.0 landed
-
Address more review comments on commit 2d819a08a1.
- 846311051e8f 17.0 landed
-
Fix unreachable code warning from commit 2d819a08a1.
- 61f352ece9e7 17.0 landed
-
Introduce "builtin" collation provider.
- 2d819a08a1cb 17.0 landed
-
Catalog changes preparing for builtin collation provider.
- f696c0cd5f29 17.0 landed
-
Unicode case mapping tables and functions.
- 5c40364dd6d9 17.0 landed
-
Add Unicode property tables.
- ad49994538c5 17.0 landed
-
Documentation update for Standard Collations.
- 875e46a0a246 17.0 landed
-
Cleanup for unicode-update build target and test.
- cf64d4e99f64 17.0 landed
-
Shrink Unicode category table.
- 719b342d36ce 17.0 landed
-
Make some error strings more generic
- 36a14afc0760 17.0 cited
-
pg_upgrade: copy locale and encoding information to new cluster.
- 9637badd9f92 16.0 cited
-
Update Unicode data to Unicode 15.0.0
- 1091b48cd761 16.0 cited
-
Create a new type category for "internal use" types.
- 07eee5a0dc64 15.0 cited