Re: Wrong sorting on docker image - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Wrong sorting on docker image
Date
Msg-id YWrGY2xWibiqa0GP@hjp.at
Whole thread Raw
In response to Wrong sorting on docker image  (Oleksandr Voytsekhovskyy <young.inbox@gmail.com>)
List pgsql-general
On 2021-10-16 13:50:31 +0300, Oleksandr Voytsekhovskyy wrote:
> Starting from version 12.0 official docker image switched from Debian-stretch
> to Debian-bullseye and from that point we have a huge pain with sorting issues
> on Russian collation.
[...]
> Issue:
>
> postgres=# SELECT * FROM unnest(ARRAY ['ея', 'ёа']) name ORDER BY name;
>  name
> ------
>  ёа
>  ея
> (2 строки)
>
>
>
>   еqя should go before  ёqа

Same with the sort command in the shell.


> postgres=# SELECT 'ея' COLLATE "ru_RU" < 'ёа' COLLATE "ru_RU";
>  ?column?
> ----------
>  f
> (1 строка)
>
> And should be TRUE here
>
> Any idea how to fix that?

Since the collation is defined by the OS (or rather its C library)
I think this should be reported to Debian or possibly the glibc
maintainers.

PostgreSQL can also use the ICU locales instead of those provided by the
OS. Have you tried that?

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Oleksandr Voytsekhovskyy
Date:
Subject: Wrong sorting on docker image
Next
From: Tom Lane
Date:
Subject: Re: Wrong sorting on docker image