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-03-10T09:52:41Z
Lists: pgsql-hackers

Attachments

On 05.03.22 09:38, Julien Rouhaud wrote:
> @@ -168,18 +175,6 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
>                       errmsg("collation \"default\" cannot be copied")));
>      }
> 
> -   if (localeEl)
> -   {
> -       collcollate = defGetString(localeEl);
> -       collctype = defGetString(localeEl);
> -   }
> [...]
> 
> I tried to read the function and quickly got confused about whether possible
> problematic conditions could be reached or not and had protection or not.  I
> think that DefineCollation is becoming more and more unreadable, with a mix of
> fromEl, !fromEl and either.  Maybe it would be a good time to refactor the code
> a bit and have have something like
> 
> if (fromEl)
> {
>      // initialize all specific things
> }
> else
> {
>      // initialize all specific things
> }
> 
> // handle defaults and sanity checks
> 
> What do you think?

How about the attached?

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