From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: case insensitive collation of Greek's sigma
Date: Fri, 26 Nov 2021 10:21:37 +0200
Message-ID: <76daf006-88e9-a790-cfac-e018cd6038b8@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAC1JxDQhi_M4WO4e19qPmcOGpN6NKJz60zsdXMuCHwVuE3_Ldw@mail.gmail.com>
References: <CAC1JxDQhi_M4WO4e19qPmcOGpN6NKJz60zsdXMuCHwVuE3_Ldw@mail.gmail.com>
On 26/11/21 9:37 π.μ., Jakub Jedelsky wrote:
> Hello,
Thank you for dealing with Greek!
>
> during our tests of Postgres with ICU we found an issue with ILIKE of upper and lowercase sigma (Σ). The letter has two lowercase variants σ and ς (at the end of a word). I'm working with en_US and
> en-US-x-icu collations and results are a bit unexpected - they are inverted:
>
> postgres=# SELECT
> postgres-# 'ΣΣ' ILIKE 'σσ' COLLATE "en_US",
> postgres-# 'ΣΣ' ILIKE 'σς' COLLATE "en_US"
> postgres-# ;
> ?column? | ?column?
> ----------+----------
> t | f
> (1 row)
>
> postgres=# SELECT
> postgres-# 'ΣΣ' ILIKE 'σσ' COLLATE "en-US-x-icu",
> postgres-# 'ΣΣ' ILIKE 'σς' COLLATE "en-US-x-icu";
> ?column? | ?column?
> ----------+----------
> f | t
> (1 row)
>
> I run those commands on the latest (14.1) official docker image.
>
> Is it possible to unify the behaviour?And which one is correct from the community point of view?
IMHO all those letters are wrong, the correct S used to be the letter C (equal to the Cyrillic S).
Σ is a new invention, same like σ, the final ς looks a lot like the calligraphic version of c .
>
> If I could start, I think both results are wrong as both should return True. If I got it right, in the background there is a lower() function running to compare strings, which is not enough for such
> cases (until the left side isn't taken as a standalone word).
I agree with you all of them should be deducted to a single letter s. Firefox's find recognizes all three (Σ,σ,ς) as the same letter.
>
> Thanks,
>
> - jj
--
Achilleas Mantzios
DBA, Analyst, IT Lead
IT DEPT
Dynacom Tankers Mgmt
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: case insensitive collation of Greek's sigma
In-Reply-To: <76daf006-88e9-a790-cfac-e018cd6038b8@matrix.gatewaynet.com>
References: <CAC1JxDQhi_M4WO4e19qPmcOGpN6NKJz60zsdXMuCHwVuE3_Ldw@mail.gmail.com> <76daf006-88e9-a790-cfac-e018cd6038b8@matrix.gatewaynet.com>
* 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