From: Laurenz Albe <laurenz.albe@cybertec.at>
To: patrick.van.dijk@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18523: String compare not consistent
Date: Wed, 26 Jun 2024 17:59:24 +0200
Message-ID: <3a173a9aba9650ce7ddf22af9c413a3d64debbf4.camel@cybertec.at> (raw)
In-Reply-To: <18523-d7b3cacb64d91cda@postgresql.org>
References: <18523-d7b3cacb64d91cda@postgresql.org>
On Wed, 2024-06-26 at 09:43 +0000, PG Bug reporting form wrote:
> PostgreSQL version: 16.3
> Operating system: Windows vs Linux/Azure
>
> When I try the following on a Azure/Linux version of PostgreSQL i see some
> strange results that are not correct.
> On Windows the behavior is correct.
>
> select '|' < '0'; -- true, true, this is correct
> select '|1' < '01'; -- false, true, Azure/Linux is wrong
> select '||' < '0|'; -- true, true, this is correct
> select '||1' < '0|1'; -- false, true, Azure/Linux is wrong
>
> When the first character compares <, then no matter what follows, it should
> be <...
That is certainly not a PostgreSQL bug, because PostgreSQL uses collations
defined by the C library (or the ICU library, if you use that).
So you'd have to complain to the authors of the respective library.
Interestingly, glibc and ICU disagree about that:
SELECT '|1' < '01' COLLATE "de_DE.utf8" AS glibc,
'|1' < '01' COLLATE "de-AT-x-icu" AS icu;
glibc │ icu
═══════╪═════
f │ t
(1 row)
Yours,
Laurenz Albe
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: laurenz.albe@cybertec.at, patrick.van.dijk@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18523: String compare not consistent
In-Reply-To: <3a173a9aba9650ce7ddf22af9c413a3d64debbf4.camel@cybertec.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