Sample Header Ad - 728x90

Equivalent of utf8_general_ci in Postgres/ICU?

2 votes
1 answer
1195 views
In MySQL there is a collation utf8_general_ci which provides case-insensitive comparisons in a variety of languages. For example, these are all 1 (true):
SELECT 'ı' = 'I' SOLLATE 'utf8_general_ci';
SELECT 'i' = 'I' COLLATE 'utf8_general_ci';
SELECT 'ä' = 'Ä' COLLATE 'utf8_general_ci';
Can I define a similar collation using PostgreSQL's ICU? I tried
CREATE COLLATION "undefined_ci_nondet_old" (
  PROVIDER = 'icu',
  LOCALE = "@colStrength=secondary",
  DETERMINISTIC = false
);
But that doesn't seem to include the Turkish I/ı conversion:
SELECT 'ı' = 'I' COLLATE undefined_ci_nondet_old; -- false
Asked by AndreKR (607 rep)
May 9, 2021, 10:00 PM
Last activity: May 10, 2021, 01:12 PM