From: Daniel Verite <daniel@manitou-mail.org>
To: iksss.88@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15805: Problem with lower function for greek sigma (Σ) letter
Date: Wed, 15 May 2019 17:31:45 +0200
Message-ID: <5d80ac2d-3f1f-4d60-88a8-5602eb9978a3@manitou-mail.org> (raw)
In-Reply-To: <15805-c2d0a529470e5b5f@postgresql.org>
PG Bug reporting form wrote:
> lower('ΔΗΜΟΤΕΣ ΦΑΙΣΤΟΥ') =
> "δημοτεσ φαιστου" instead of "δημοτες φαιστου"
With PostgreSQL version 10 or newer, you could use an ICU
locale. lower() would produce the expected result:
psql (11.3 (Debian 11.3-1.pgdg90+1))
=> select lower('ΔΗΜΟΤΕΣ ΦΑΙΣΤΟΥ' collate "und-x-icu");
lower
-----------------
δημοτες φαιστου
(1 row)
This case looks comparable to the case of the german ß (sharp s),
which should be upcased into 'SS', but the locales backed by libc
don't do that:
=> select upper(''Ich muß');
upper
---------
ICH MUß
For that exemple as well, an ICU locale produces a correct
result with regard to linguistic rules:
=> select upper('Ich muß' collate "und-x-icu");
upper
----------
ICH MUSS
The libc library provides an API with character-by-character
case conversions (tolower/toupper), which is too limited
to deal with the above cases, and PostgreSQL basically
just uses this API.
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
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-bugs@postgresql.org
Cc: daniel@manitou-mail.org, iksss.88@gmail.com
Subject: Re: BUG #15805: Problem with lower function for greek sigma (Σ) letter
In-Reply-To: <5d80ac2d-3f1f-4d60-88a8-5602eb9978a3@manitou-mail.org>
References: <15805-c2d0a529470e5b5f@postgresql.org> <5d80ac2d-3f1f-4d60-88a8-5602eb9978a3@manitou-mail.org>
* 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