Re: Case Insensitive Comparison with Postgres 12

Поиск
Список
Период
Сортировка
Искать
От
Thomas Kellerer
Тема
Re: Case Insensitive Comparison with Postgres 12
Дата
Msg-id
7f3e8791-fa18-b355-d377-465cba605616@gmx.net
Ответ на
Список
Дерево обсуждения
Case Insensitive Comparison with Postgres 12 Igal Sapir <igal@lucee.org>
Re: Case Insensitive Comparison with Postgres 12 Laurenz Albe <laurenz.albe@cybertec.at>
Re: Case Insensitive Comparison with Postgres 12 "Igal @ Lucee.org" <igal@lucee.org>
Re: Case Insensitive Comparison with Postgres 12 Thomas Kellerer <spam_eater@gmx.net>
Re: Case Insensitive Comparison with Postgres 12 "Igal @ Lucee.org" <igal@lucee.org>
Re: Case Insensitive Comparison with Postgres 12 Wim Bertels <wim.bertels@ucll.be>
Re: Case Insensitive Comparison with Postgres 12 Morris de Oryx <morrisdeoryx@gmail.com>
Re: Case Insensitive Comparison with Postgres 12 Pavel Křehula <pavel.krehula@nlm.cz>
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@colStrength=secondary'

In your case I guess, it should be 

   locale = 'en-US@colStrength=secondary'

Thomas


В списке pgsql-general по дате отправления
От: Jehan-Guillaume de Rorthais
Дата:
От: Tom Lane
Дата:
FAQ