Re: Case Insensitive Comparison with Postgres 12

From: "Igal (at) Lucee(dot)org" <igal(at)lucee(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Case Insensitive Comparison with Postgres 12
Date: 2019-10-10 15:34:26
Message-ID: d549e8ae-789b-781c-7b07-1850ae9f3294@lucee.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas,

On 10/10/2019 6:22 AM, Thomas Kellerer wrote:

> Igal @ Lucee.org schrieb am 10.10.2019 um 14:41:
>> Thank you all for replying. I tried to use the locale suggested by
>> both Laurenz and Pavel, en-US-u-ks-level2, but I'm still getting
>> false for a simple comparison of 'Abc' = 'abc'. I tried the locale
>> both as a 'string' and as an "identifier":
>>
>>> drop collation if exists case_insensitive;
>>> create collation case_insensitive (
>>    provider=icu, locale="en-US-u-ks-level2", deterministic=false
>> );
>>
>>> select 'Abc' = 'abc' collate case_insensitive as is_equal;
>> is_equal|
>> --------|
>> false   |
>>
>> What am I doing wrong here?
> Check the version of libicu that your Linux is using.
> That locale format requires version 54 or later.
> (My up-to-date CentOS 7.7 for example is still using version 50 and the EDB Windows binaries include version 53).
>
> In another thread about ICU problems, Daniel Verite explained that in more detail:
>
>> With ICU 53 or older, instead of the locale above, we must use the old-style syntax:
>>
>> locale = 'de-DE(at)colStrength=secondary'
> In your case I guess, it should be
>
> locale = 'en-US(at)colStrength=secondary'

That works, thank you!

I also have CentOS installed on that machine: CentOS Linux release
7.7.1908 (Core), showing libicu Version 50.2 via `yum info libicu`.

Best,

Igal

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yessica Brinkmann 2019-10-10 15:55:43 The connection to the server was lost. Attempting reset: Failed.
Previous Message PASCAL CROZET 2019-10-10 15:30:57 RE: plpgsql copy import csv double quotes