Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblp8-0001RK-QD for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 15:42:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mblp7-0007fy-Ad for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 15:42:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblp7-0007e7-0s for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 15:42:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblp0-0001Ja-8A for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 15:42:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19GFg2sR1061943; Sat, 16 Oct 2021 11:42:02 -0400 From: Tom Lane To: Oleksandr Voytsekhovskyy cc: PostgreSQL General Subject: Re: Wrong sorting on docker image In-reply-to: References: Comments: In-reply-to Oleksandr Voytsekhovskyy message dated "Sat, 16 Oct 2021 13:50:31 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1061941.1634398922.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 16 Oct 2021 11:42:02 -0400 Message-ID: <1061942.1634398922@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Oleksandr Voytsekhovskyy writes: > Starting from version 12.0 official docker image switched from Debian-st= retch to Debian-bullseye and from that point we have a huge pain with sort= ing issues on Russian collation. Yeah, Debian versions after stretch adopted the significant glibc locale data changes (sorting rule changes) that are discussed at [1]. > =D0=B5=D1=8F should go before =D1=91=D0=B0 I'm not qualified to have an opinion on that point, but one would hope that the glibc people who changed the sorting rules are qualified. If you disagree, you need to go discuss it with glibc. Postgres doesn't define any text sorting rules, we just use what libc or ICU tells us. Speaking of ICU, if you are using an ICU-enabled Postgres build, maybe you could find an ICU collation that acts the way you want. This wouldn't be a perfect solution, because we don't yet have the ability to set an ICU collation as a database's default. But you can attach ICU collations to individual text columns, and maybe that would be a good enough workaround. regards, tom lane [1] https://wiki.postgresql.org/wiki/Locale_data_changes