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 1pRtg5-0000c7-5e for pgsql-general@arkaria.postgresql.org; Tue, 14 Feb 2023 11:40:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pRtg3-0008Ti-MJ for pgsql-general@arkaria.postgresql.org; Tue, 14 Feb 2023 11:40:51 +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 1pRtg3-0008TZ-6k for pgsql-general@lists.postgresql.org; Tue, 14 Feb 2023 11:40:51 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pRtg0-0006tU-Ct for pgsql-general@postgresql.org; Tue, 14 Feb 2023 11:40:50 +0000 Received: by mail-ed1-x529.google.com with SMTP id d40so15660422eda.8 for ; Tue, 14 Feb 2023 03:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=avOl1AyDQ9S4SlaXq+iB18V4IaCXf+axBdT4WyDei9M=; b=e2smqjH6WSF2QZhswnu17EtmPSGHx7LNFLEAioUh2+1qQQSiCrjRc5LlBhJs2i8VTG KZ47Jh6Rutn7mmuOgq1YGS37nWw21Pyih8Rt79hQ32zAoBKIMzr4Bq1F79hV47DnnYxw xeMtUfKrinKnj0UkpeNyt8Fj9IqSaZaQrxZisMEtnK8TSQ5WGJhy5bAaQ3oexOzUdmGp cwooqodiPlXdolPfuXmuvO5ok2YVYz/RNeWEYmAotDmULHcWN5ColvYdBYUl+O3kL1L5 FGrhMRuMBgE5GOCbYq+AHWMQj+MqDM9+62sMitpcIZawC98rDoxswi5Rd+70rhCYeYzQ m8PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=avOl1AyDQ9S4SlaXq+iB18V4IaCXf+axBdT4WyDei9M=; b=br/T793/dqfzh4AwpWMffGMp99WY2lhLEItqSH2YbJFQBvB+GbggHz8/SQ25BjUCmR X+k7TeclRjr/nhIlKXG/NlfxAEsgEmZwXbJ+6KnxtHRmcnqfbOYZibgw4nK1B6E0YuGp dxCgN8rViQOxbEsYPuYe5Am9E1+xX5aDQU/JXAmkIfR//hxlejHenR9PBrXHiX/ZxhvL Rrb2G77S0S2blh65SiBd0JgKyi9L/4pixgXrEDbkXRe9dFq98ssYKEjR6ShuXaOSYndO iNnCQndCJPez183ssqcKoYZUucAs51py6ILGhvP5N0zwWOV3qWDUyuHhSr0L6xYsHRvg QCBQ== X-Gm-Message-State: AO0yUKUcsA9EipmVLgM4wuX7FxrTNiB/Deu2hSwybtLfxJbXeojUmHqj /UBlLFKlasWHd3mnXp6ORUnbQRKQm/3wPtgb X-Google-Smtp-Source: AK7set869OIcZ/WNYA/QGUhGf4FailoOEwE+ZDleCEGWmPTA1OkqidWKWmyOtCMEU1v1rPn4sJqbVg== X-Received: by 2002:a05:6402:5213:b0:4aa:cf80:44af with SMTP id s19-20020a056402521300b004aacf8044afmr11568832edd.7.1676374847172; Tue, 14 Feb 2023 03:40:47 -0800 (PST) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:5e:539:1b2c:c52a:475d:310c]) by smtp.gmail.com with ESMTPSA id w9-20020a50d789000000b004aacee2728dsm7899898edi.19.2023.02.14.03.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 03:40:46 -0800 (PST) Message-ID: <2d3c66e7c075ae9efe691eaa3b1040c6ce393ed7.camel@cybertec.at> Subject: Re: Losing my latin on Ordering... From: Laurenz Albe To: Dominique Devienne Cc: pgsql-general@postgresql.org Date: Tue, 14 Feb 2023 12:40:46 +0100 In-Reply-To: References: <5f395b5b2e1f135f487acb96882f89d012fead13.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-02-14 at 12:17 +0100, Dominique Devienne wrote: > On Tue, Feb 14, 2023 at 11:23 AM Laurenz Albe = wrote: > > On Tue, 2023-02-14 at 10:31 +0100, Dominique Devienne wrote: > > > Surely sorting should be "constant left-to-right", no? What are we mi= ssing? > >=20 > > No, it isn't.=C2=A0 That's not how natural language collations work. >=20 > Honestly, who expects the same prefix to sort differently based on what c= omes > after, in left-to-right languages? > How does one even find out what the (capricious?) rules for sorting in a = given > collation are? Look at the documentation / implementation. As far as ICU is concerned, here: https://unicode.org/reports/tr10/ > > > I'm already surprised (star) comes before (space), when the latter "c= omes > > > before" the former in both ASCII and UTF-8, but that the two "Foo*" a= nd "Foo " > > > prefixed pairs are not clustered after sorting is just mistifying to = me. So how come? > >=20 > > Because they compare identical on the first three levels.=C2=A0 Any dif= ference in > > letters, accents or case weighs stronger, even if it occurs to the righ= t > > of these substrings. >=20 > That's completely unintuitive... Well, you can complain to GNU and the Unicode consortium, but that's pretty much the way it is. > > Yes, it soulds like the "C" collation may be best for you.=C2=A0 That i= s, if you don't > > mind that "Z" < "a". >=20 > I would mind if I asked for case-insensitive comparisons. >=20 > So the "C" collation is fine with general UTF-8 encoding? > I.e. it will be codepoint ordered OK? Yes, exactly. Yours, Laurenz Albe