Re: Case Insensitive Comparison with Postgres 12 - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Case Insensitive Comparison with Postgres 12
Date
Msg-id 9ad4f42faa10f1aa4e81e3ed8160d36d0d39856a.camel@cybertec.at
Whole thread Raw
In response to Case Insensitive Comparison with Postgres 12  (Igal Sapir <igal@lucee.org>)
Responses Re: Case Insensitive Comparison with Postgres 12
List pgsql-general
Igal Sapir wrote:
> I am trying to test a simple case insensitive comparison.  Most likely the
> collation that I chose is wrong, but I'm not sure how to choose the correct
> one (for English/US?).  Here is my snippet:
> 
> create collation case_insensitive(
>     provider=icu, locale='en-US-x-icu', deterministic=false
> );
> select 'Abc' = 'abc' collate case_insensitive;
> 
> I expected true but am getting false.
> 
> Any thoughts?

Yes, the LOCALE is wrong. Use

create collation case_insensitive (
   provider=icu, locale='en-US-u-ks-level2', deterministic=false
);

The name of the locale defines it.

My blog post can give a simple introduction:
https://www.cybertec-postgresql.com/en/icu-collations-against-glibc-2-28-data-corruption/

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: Wim Bertels
Date:
Subject: Re: Case Insensitive Comparison with Postgres 12
Next
From: Allan Jensen
Date:
Subject: GSSAPI: logging principal