pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: Oleksandr Voytsekhovskyy <young.inbox@gmail.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Wrong sorting on docker image
Date: Sat, 16 Oct 2021 14:32:35 +0200
Message-ID: <YWrGY2xWibiqa0GP@hjp.at> (raw)
In-Reply-To: <F29709C9-A061-4034-A77D-7E237CF36391@gmail.com>
References: <F29709C9-A061-4034-A77D-7E237CF36391@gmail.com>

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!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (4+ messages)  latest in thread

Message-ID: <YWrGY2xWibiqa0GP@hjp.at>
Permalink:  ../YWrGY2xWibiqa0GP@hjp.at/
Also on:    postgresql.org/message-id/YWrGY2xWibiqa0GP@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at, young.inbox@gmail.com
  Subject: Re: Wrong sorting on docker image
  In-Reply-To: <YWrGY2xWibiqa0GP@hjp.at>
  References: <F29709C9-A061-4034-A77D-7E237CF36391@gmail.com> <YWrGY2xWibiqa0GP@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox