Re: Accent insensitive search?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Accent insensitive search?
Date: 2009-03-24 09:53:04
Message-ID: gqaai0$kv1$5@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-03-18, cifroes <cifroes(at)netcabo(dot)pt> wrote:
> This is a multi-part message in MIME format.
>
> ------_=_NextPart_001_01C9A7E6.B32BBA87
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
>
> I have a DB in utf-8 and postgres 8.3.x.=20
>
> How can I do an accent insensitive search (like ...) ?

use a posix regular expression that matches the string you want:

select * from foo where colname ~ '^[CcĆćĈĉĊċČč][ĀāĂ㥹Aa][Pp][ŌōŎŏŐő]$';

you could write a function to do the translation.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2009-03-24 10:00:11 Re: Move PG installation to a new computer
Previous Message Duco Fijma 2009-03-24 09:38:02 lots of WAL files retained with restore_command through %r parameter