Re: ICU for global collation

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Daniel Verite <daniel@manitou-mail.org>
Date: 2022-01-11T11:10:14Z
Lists: pgsql-hackers
On 07.01.22 10:03, Julien Rouhaud wrote:
>> I changed the datcollate, datctype, and the new daticucoll fields to type
>> text (from name).  That way, the daticucoll field can be set to null if it's
>> not applicable.  Also, the limit of 63 characters can actually be a problem
>> if you want to use some combination of the options that ICU locales offer.
>> And for less extreme uses, having variable-length fields will save some
>> storage, since typical locale names are much shorter.
> 
> I understand the need to have daticucoll as text, however it's not clear to me
> why this has to be changed for datcollate and datctype?  IIUC those will only
> ever contain libc-based collation and are still mandatory?

Right.  I just did this for consistency.  It would be strange otherwise 
to have some fields as name and some as text.  Arguably, using "name" 
here was wrong to begin with, since they are not really object names. 
Maybe there used to be a reason to avoid variable-length fields in 
pg_database, but there isn't one now AFAICT.

> - pg_upgrade
> 
> It checks (in check_locale_and_encoding()) the compatibility for each database,
> and it looks like the daticucoll field should also be verified.  Other than
> that I don't think there is anything else needed for the pg_upgrade part as
> everything else should be handled by pg_dump (I didn't look at the changes yet
> given the below problems).

Ok, I have added this and will include it in my next patch submission.

> - CREATE DATABASE

> - initdb

Ok, some work is needed to make these interfaces behave sensibly in 
various combinations.  I will look into that.



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add CHECK_FOR_INTERRUPTS while restoring changes during decoding.

  2. Improve ICU option handling in CREATE DATABASE

  3. Don't allow creation of database with ICU locale with unsupported encoding

  4. Make locale option behavior more consistent

  5. pg_dump: Dump colliculocale

  6. Remove further unwanted linker flags from perl_embed_ldflags

  7. Doc: document possible need to raise kernel's somaxconn limit.

  8. Reduce warnings with -Wshadow=compatible-local builds

  9. Remove redundant spaces in _outA_Expr() output

  10. Fix outdated --help message for postgres -f

  11. pg_upgrade: Fix version comparison for global ICU support

  12. Silence -Wmaybe-uninitialized compiler warning in dbcommands.c.

  13. Add option to use ICU as global locale provider

  14. DefineCollation() code cleanup

  15. Change collate and ctype fields to type text

  16. Call pg_newlocale_from_collation() also with default collation

  17. Use libc version as a collation version on glibc systems.

  18. Silence -Wmaybe-uninitialized compiler warnings in dbcommands.c.

  19. Make LC_COLLATE and LC_CTYPE database-level settings. Collation and