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 1mbhH0-00005r-Iz for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 10:50:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbhGz-0004fO-6s for pgsql-general@arkaria.postgresql.org; Sat, 16 Oct 2021 10:50:41 +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 1mbhGy-0004do-NP for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 10:50:40 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mbhGs-0007ju-Ds for pgsql-general@lists.postgresql.org; Sat, 16 Oct 2021 10:50:39 +0000 Received: by mail-lf1-x12c.google.com with SMTP id x192so18149930lff.12 for ; Sat, 16 Oct 2021 03:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:mime-version:subject:message-id:date:to; bh=oVoFGdSbZiI/CxNxWjPSBW2+CUQOjQAX4cHX6kW1WG4=; b=cZtnyQjb2K8n1aKkUTeJ4iDq48jtXUgx4C6gQ+dOg8oRO3U6b2XhuZkl+R0JGZ9OR3 QIpeT2IhnMtT5WzmGMHyaW2C1QDMzq0vns5Oaa6yZ8wP3mM03VJKFWvQLsiYjvsSUQ9e KFaPhw7kDJN2/X+geV6gXKBM35r/tCi31rFNsmXgKJoPkiyv7O1gGVB/rGwjoz+nAPl2 M3k2YRgVHYNxkKLlhfn9JqqjOZ0a1qr/jWuVlE3qPQeS9Wp6yk8/uoA4H+M0hFjX+lHj B878fj+++kAqeTUKNzr9lhx4qppB97YOS1mDTly5fUcwnPnWd9ofRezzAFaM3wKSEPzY mX1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=oVoFGdSbZiI/CxNxWjPSBW2+CUQOjQAX4cHX6kW1WG4=; b=Y2vBzd11/4Q3EDbUA0HqaYhLjWFg9uVn8k+XIYb9oISuSD9SX58RkTZIraWJAEk8uy d8U6mH/LwedBQ04YxrIQx5joZbGDz1WdYJRaGRwj2DD2sVMgU8HRJKuA1XvRnfoUA+zj CT4NNe/ysDve7TxtBg+T2aLXkeXy41LrzYrpEqWdWBMsGiBnh17livc/tkxxEEXokwmL wgEr29xu2cihBlecuSu94vXrRgJRdOPIm3G95CgLvesh46gCIsCthVgsYjbjMm6oDr3C f/LlJRjlr04ipyS2vsP4x9CRUcvP908t/ShVvLVxyTNsK8LXO+VeZb2LJ8fslR9WA3dC NfGg== X-Gm-Message-State: AOAM531+qcxLHE10cS6c26WZ+YJi8WgZ3ZX66Hcdqoh3Kuyspk/zLQ34 JsvUHqO7qHnt8e1jYqVDwDLulb8/a4E= X-Google-Smtp-Source: ABdhPJwACCz2WE4qGxlgGZpk2Ve5NwjUcfqxHWNQYb8pPaA455HQtVPyZoSBqfcWQgXXy4Fk+nqPxA== X-Received: by 2002:ac2:4285:: with SMTP id m5mr15103103lfh.343.1634381432501; Sat, 16 Oct 2021 03:50:32 -0700 (PDT) Received: from smtpclient.apple ([94.45.143.133]) by smtp.gmail.com with ESMTPSA id b9sm812991lfe.85.2021.10.16.03.50.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Oct 2021 03:50:32 -0700 (PDT) From: Oleksandr Voytsekhovskyy Content-Type: multipart/alternative; boundary="Apple-Mail=_975213A0-14A8-4451-AF85-D77B8DD18C21" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Wrong sorting on docker image Message-Id: Date: Sat, 16 Oct 2021 13:50:31 +0300 To: PostgreSQL General X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_975213A0-14A8-4451-AF85-D77B8DD18C21 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Greetings 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. Dockerfile: FROM postgres:14 RUN apt-get clean && apt-get update && apt-get install -y locales RUN localedef -i ru_RU -c -f UTF-8 -A /usr/share/locale/locale.alias = ru_RU.UTF-8 ENV LANG ru_RU.utf8 postgres=3D# select version(); version = =20 = --------------------------------------------------------------------------= --------------------------------------------------- PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on x86_64-pc-linux-gnu, = compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit Issue: 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) =D0=B5q=D1=8F should go before =D1=91q=D0=B0 postgres=3D# SELECT '=D0=B5=D1=8F' COLLATE "ru_RU" < '=D1=91=D0=B0' = COLLATE "ru_RU"; ?column?=20 ---------- f (1 =D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B0) And should be TRUE here Any idea how to fix that? We are not able manage this for 3 years already ((( --Apple-Mail=_975213A0-14A8-4451-AF85-D77B8DD18C21 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Greetings

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.

Dockerfile:

FROM postgres:14
RUN apt-get clean && apt-get update && = apt-get install -y locales
RUN localedef -i ru_RU -c -f UTF-8 -A = /usr/share/locale/locale.alias ru_RU.UTF-8
ENV LANG = ru_RU.utf8

postgres=3D# select version();
         =                     =                     =           version        =                     =                     =            
---------------------------------------------------------------= --------------------------------------------------------------
 PostgreSQL 14.0 (Debian = 14.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian = 10.2.1-6) 10.2.1 20210110, 64-bit


Issue:

postgres=3D# SELECT * FROM unnest(ARRAY = ['=D0=B5=D1=8F', '=D1=91=D0=B0']) name ORDER BY name;
 name 
------
 =D1=91=D0=B0
 =D0=B5=D1=8F
(2 = =D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B8)



  = =D0=B5q=D1=8F should go before  =D1=91q=D0=B0

postgres=3D# SELECT '=D0=B5=D1=8F' = COLLATE "ru_RU" < '=D1=91=D0=B0' COLLATE "ru_RU";
 ?column? 
----------
 f
(1 =D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B0)

And should be = TRUE here

Any = idea how to fix that?

We are not able manage this for 3 years already (((


= --Apple-Mail=_975213A0-14A8-4451-AF85-D77B8DD18C21--