Re: Accent insensitive search? - Mailing list pgsql-general

From Jasen Betts
Subject Re: Accent insensitive search?
Date
Msg-id gqaai0$kv1$5@reversiblemaps.ath.cx
Whole thread Raw
In response to Accent insensitive search?  ("cifroes" <cifroes@netcabo.pt>)
Responses Re: Accent insensitive search?
List pgsql-general
On 2009-03-18, cifroes <cifroes@netcabo.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.


pgsql-general by date:

Previous
From: Duco Fijma
Date:
Subject: lots of WAL files retained with restore_command through %r parameter
Next
From: Thomas Kellerer
Date:
Subject: Re: Move PG installation to a new computer