Re: Accent insensitive search?

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Pedro Doria Meunier <pdoria(at)netmadeira(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Accent insensitive search?
Date: 2009-03-18 16:53:40
Message-ID: bddc86150903180953g65ecee0ag8917266e1e01f0cc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/3/18 Pedro Doria Meunier <pdoria(at)netmadeira(dot)com>

> Hi,
>
> use ILIKE
>
> HTH,
>

ILIKE is only case-insensitive, and won't match accented characters. The
only thing I can think of doing is to create a function which will replace
characters with their equivalent non-accented counterparts and use that in
the query.

Example: SELECT name FROM people WHERE unaccent_string(name) ~* 'Pédro';

The function would perform a reg-ex replace similar to: s/[èééêë]/e

Just an idea

Thom

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2009-03-18 17:07:52 Re: Accent insensitive search?
Previous Message cifroes 2009-03-18 16:49:34 Re: Accent insensitive search?