Re: ICU_LOCALE set database default icu collation but not working as intended.

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "jian he" <jian(dot)universality(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ICU_LOCALE set database default icu collation but not working as intended.
Date: 2022-05-26 20:14:46
Message-ID: 64c7998e-d877-49e9-a98d-5fca8f24762f@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he wrote:

> CREATE
> DATABASE dbicu1 LOCALE_PROVIDER icu LOCALE 'en_US.UTF-8' ICU_LOCALE
> 'en-u-kf-upper' TEMPLATE 'template0';
> CREATE DATABASE dbicu2 LOCALE_PROVIDER icu LOCALE 'en_US.UTF-8' ICU_LOCALE
> 'en-u-kr-latn-digit' TEMPLATE 'template0';
> [...]
> I am not sure this is my personal misunderstanding.
> In the above examples, the first character of column *test_kr*
> is so different that the comparison is based on the first letter.
> If the first letter is the same then compute the second letter..
> So for whatever collation, I should expect 'A 19' to be adjacent with 'A
> 11'?

The query "SELECT test_kr FROM icu ORDER BY def;"
does not order by test_kr, so the contents of test_kr have no bearing
on the order of the results.

If you order by test_kr, the results look like what you're expecting:

dbicu1=# SELECT test_kr,def FROM icu ORDER BY test_kr;
test_kr | def
---------+-----
1 a | a
8 p | B
A 11 | b
A 19 | A
a 7 | a
Π1 | a

dbicu2=# SELECT test_kr,def FROM icu ORDER BY test_kr ;
test_kr | def
---------+-----
A 11 | b
A 19 | A
a 7 | a
Π1 | a
1 a | a
8 p | B

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2022-05-26 20:21:15 Re: Patch: Don't set LoadedSSL unless secure_initialize succeeds
Previous Message Gurjeet Singh 2022-05-26 20:01:00 Re: Patch: Don't set LoadedSSL unless secure_initialize succeeds