Re: ICU for global collation

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ICU for global collation
Date: 2019-08-21 06:56:03
Message-ID: 53008C67-AA12-4CE8-9DEC-C21B9E1D57A8@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

> 20 авг. 2019 г., в 19:21, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> написал(а):
>
> Here is an initial patch to add the option to use ICU as the global
> collation provider, a long-requested feature.
>
> To activate, use something like
>
> initdb --collation-provider=icu --locale=...
>
> A trick here is that since we need to also still set the normal POSIX
> locales, the --locale value needs to be valid as both a POSIX locale and
> a ICU locale. If that doesn't work out, there is also a way to specify
> it separately, e.g.,
>
> initdb --collation-provider=icu --locale=en_US.utf8 --icu-locale=en

Thanks! This is very awaited feature.

Seems like user cannot change locale for database if icu is already chosen?

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Provider | Access privileges
-----------+-------+----------+---------+-------+----------+-------------------
postgres | x4mmm | UTF8 | ru_RU | ru_RU | icu |
template0 | x4mmm | UTF8 | ru_RU | ru_RU | icu | =c/x4mmm +
| | | | | | x4mmm=CTc/x4mmm
template1 | x4mmm | UTF8 | ru_RU | ru_RU | icu | =c/x4mmm +
| | | | | | x4mmm=CTc/x4mmm
(3 rows)

postgres=# create database a template template0 collation_provider icu lc_collate 'en_US.utf8';
CREATE DATABASE
postgres=# \c a
2019-08-21 11:43:40.379 +05 [41509] FATAL: collations with different collate and ctype values are not supported by ICU
FATAL: collations with different collate and ctype values are not supported by ICU
Previous connection kept

Am I missing something?

BTW, psql does not know about collation_provider.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-08-21 07:12:24 Re: Add "password_protocol" connection parameter to libpq
Previous Message Jeff Davis 2019-08-21 05:33:47 Re: range_agg