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 1mqWUQ-0006lp-6p for pgsql-general@arkaria.postgresql.org; Fri, 26 Nov 2021 08:21:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mqWUP-0002E3-05 for pgsql-general@arkaria.postgresql.org; Fri, 26 Nov 2021 08:21:49 +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 1mqWUO-0002Du-KZ for pgsql-general@lists.postgresql.org; Fri, 26 Nov 2021 08:21:48 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqWUL-0002Dl-Kx for pgsql-general@lists.postgresql.org; Fri, 26 Nov 2021 08:21:47 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 1AQ8LcBX023336 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Nov 2021 10:21:43 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id 1AQ8Lbqe045079 for ; Fri, 26 Nov 2021 10:21:37 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: case insensitive collation of Greek's sigma To: pgsql-general@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: <76daf006-88e9-a790-cfac-e018cd6038b8@matrix.gatewaynet.com> Date: Fri, 26 Nov 2021 10:21:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.102.4 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-29.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hermes.gatewaynet.com X-Synonym: Copied by Synonym dcm to: approvals@mail2sma.internal.net List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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