From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Marina Garrido Sanchez <garridosanchezmarina@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16020: ICU Collations querys
Date: Thu, 26 Sep 2019 18:28:39 +0200
Message-ID: <2e46edd2-b742-7a7b-1a92-867cf4dea896@2ndquadrant.com> (raw)
In-Reply-To: <CAHUm-e2zuJ8nVAXZi0D72zyT8XF_xO1Jo_4de4fnqnxhe035iA@mail.gmail.com>
References: <16020-6586d17516c1d085@postgresql.org>
<e156f749-f49e-f5f4-7de3-32c2881fe4d5@2ndquadrant.com>
<CAHUm-e1xYfh14EXsecohsW0ex_GdBM-y2jSn6s_aPj-OZXq5YQ@mail.gmail.com>
<CAHUm-e2zuJ8nVAXZi0D72zyT8XF_xO1Jo_4de4fnqnxhe035iA@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, garridosanchezmarina@gmail.com
Subject: Re: BUG #16020: ICU Collations querys
In-Reply-To: <2e46edd2-b742-7a7b-1a92-867cf4dea896@2ndquadrant.com>
References: <16020-6586d17516c1d085@postgresql.org> <e156f749-f49e-f5f4-7de3-32c2881fe4d5@2ndquadrant.com> <CAHUm-e1xYfh14EXsecohsW0ex_GdBM-y2jSn6s_aPj-OZXq5YQ@mail.gmail.com> <CAHUm-e2zuJ8nVAXZi0D72zyT8XF_xO1Jo_4de4fnqnxhe035iA@mail.gmail.com> <2e46edd2-b742-7a7b-1a92-867cf4dea896@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox