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 1mbirm-0003lB-C0 for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 12:32:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbirl-0003A3-1p for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 12:32:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbirk-00039t-OJ for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 12:32:44 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbire-0008PF-Hv for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 12:32:43 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 3B2EA58C7; Sat, 16 Oct 2021 14:32:35 +0200 (CEST) Date: Sat, 16 Oct 2021 14:32:35 +0200 From: "Peter J. Holzer" To: Oleksandr Voytsekhovskyy Cc: PostgreSQL General Subject: Re: Wrong sorting on docker image Message-ID: Mail-Followup-To: Oleksandr Voytsekhovskyy , PostgreSQL General References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WhWjXeqaOlog8R7e" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --WhWjXeqaOlog8R7e Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-10-16 13:50:31 +0300, Oleksandr Voytsekhovskyy wrote: > Starting from version 12.0 official docker image switched from Debian-str= etch > to Debian-bullseye and from that point we have a huge pain with sorting i= ssues > on Russian collation. [...] > Issue: >=20 > postgres=3D# SELECT * FROM unnest(ARRAY ['=D0=B5=D1=8F', '=D1=91=D0=B0'])= name ORDER BY name; > name=20 > ------ > =D1=91=D0=B0 > =D0=B5=D1=8F > (2 =D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B8) >=20 >=20 >=20 > =D0=B5q=D1=8F should go before =D1=91q=D0=B0 Same with the sort command in the shell. > postgres=3D# SELECT '=D0=B5=D1=8F' COLLATE "ru_RU" < '=D1=91=D0=B0' COLLA= TE "ru_RU"; > ?column?=20 > ---------- > f > (1 =D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B0) >=20 > And should be TRUE here >=20 > 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 --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --WhWjXeqaOlog8R7e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmFqxl4ACgkQ8g5IURL+ KF3Msw//UyLpt3AsIxOpUGl0QB9PDe564yIkVb6BedpDupWhrBIIWo7lBQRFePru CDRL/2Xl7SEYgUtU9SRgj3aL37JiOfRF3dGJExMdyVjCZMyt7dEUBM9yX23zuD4b R9n2DfEwxHWMmEUYmnNw1e3PYdJIV7HrghGs+vJa3ys0IuTdzzecxDlX16eZdBqL SHP8RmwsrkHGIcW+KvH6zz9n3IeWp1AG9Bnn7hlds0Js9rrDUyGGnReqsxcTMxbW Dwv79snA+HT++D3tSIWYfbEINTWH+LXe/zBaVa9bee8RfEBrBg6lIsusC8RpiGee Z/KXZbGNIEGe8qQQelIE/baqWEswy9/1Nk0XEFZ5iW50fEgjlLsyizEEnWYmiicl 3nXTg/5F4jTyNXmGsSGRAoXR77MAqKO+YMkq15l+DB/dri4N5M3fexbWWJd03Mqc meVtTCvKUjkuQ25EiGReLsKImhIdpFWyESIlaMX+k+6b1wfq31hlE9mHyqpDSAyS LeiwOKQrA5PyMCt83s6Pve2pPJPCWw50ucVqaQCUJpnXYUA6Tho4Yew6r+k5RppC NIgppXsKBZdhreMkqkMeKuP2SOCC69LS6CMeFUuuETrTlXKA9NWtX+MGqtG5Ct/4 UP3l67MIDQW2Cks8G9Bt1ofNTLd4lNMBuAAxVst+t/i8pJdeGuI= =KxYj -----END PGP SIGNATURE----- --WhWjXeqaOlog8R7e--