Re: BUG #16020: ICU Collations querys - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #16020: ICU Collations querys
Date
Msg-id 2e46edd2-b742-7a7b-1a92-867cf4dea896@2ndquadrant.com
Whole thread Raw
In response to Re: BUG #16020: ICU Collations querys  (Marina Garrido Sanchez <garridosanchezmarina@gmail.com>)
List pgsql-bugs
On 2019-09-26 17:14, Marina Garrido Sanchez wrote:
> create collation ca_insensitive (provider = icu, locale =
> 'es-ES-u-ks-level1', deterministic = false;
> 
> create table users (
> nombre text collate "ca_insensitive" primary key unique,
> apellidos text collate "ca_insensitive",
> direccion text
> );
> 
> insert into user values ("jávier", "gonzález", "BBB")
> insert into user values ("Javier", "Gonzalez", "BBB")
> 
> and if I do the query:
> 
> select * from users where users.apellidos ilike '%Gonz%';
> 
> I get the error that *ilike *does not support nondeterministic
> operation, for that, my question is How can I do partial match search
> with case- and accet- insensitive in postgres? or Which operator can I
> use to do the search?

You can run your query with an explicit deterministic collation applied,
for example:

select * from users where users.apellidos ilike '%Gonz%' collate "C";

or "und-x-icu" or whatever.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-bugs by date:

Previous
From: William Burke
Date:
Subject: Re: [External] Re: BUG #16023: in PgAdmin4.13, unable to recompilefunctions that have "search_path" set at the function level
Next
From: Tom Lane
Date:
Subject: Re: BUG #16027: Invalid output of to_timestamp