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