Re: ICU_LOCALE set database default icu collation but not working as intended. - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: ICU_LOCALE set database default icu collation but not working as intended.
Date
Msg-id 64c7998e-d877-49e9-a98d-5fca8f24762f@manitou-mail.org
Whole thread Raw
In response to ICU_LOCALE set database default icu collation but not working as intended.  (jian he <jian.universality@gmail.com>)
Responses Re: ICU_LOCALE set database default icu collation but not working as intended.
List 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



pgsql-hackers by date:

Previous
From: Gurjeet Singh
Date:
Subject: Re: Patch: Don't set LoadedSSL unless secure_initialize succeeds
Next
From: Gurjeet Singh
Date:
Subject: Re: Patch: Don't set LoadedSSL unless secure_initialize succeeds