Re: BUG #15805: Problem with lower function for greek sigma (Σ) letter

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: iksss(dot)88(at)gmail(dot)com,pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15805: Problem with lower function for greek sigma (Σ) letter
Date: 2019-05-15 15:31:45
Message-ID: 5d80ac2d-3f1f-4d60-88a8-5602eb9978a3@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-05-15 15:46:29 Re: BUG #15805: Problem with lower function for greek sigma (Σ) letter
Previous Message Tom Lane 2019-05-15 14:39:49 Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND