Re: Accent insensitive search - Mailing list pgsql-general

From Ian Barwick
Subject Re: Accent insensitive search
Date
Msg-id 200307012139.08201.barwick@gmx.net
Whole thread Raw
In response to Accent insensitive search  (Alejandro Javier Pomeraniec <apomeraniec@buenosaires.gov.ar>)
List pgsql-general
On Tuesday 01 July 2003 17:11, Alejandro Javier Pomeraniec wrote:
> Hi ! Does anyone knows how to make accent insensitive searches??
>
> For example
>
> i have this data in a table
>
> --------
> Colón
> Polo
> --------
>
> I need that this query
>
> SELECT * FROM testtable WHERE testfield like '%olo%';
>
> brings both results instead of only showing Polo.

One solution[*]:

SELECT * FROM testtable WHERE to_ascii(testfield,'LATIN1') LIKE '%olo%'

Note this might not work with all database encodings, especially UNICODE.

[*] no doubt someone will be along in a moment with another.


Ian Barwick
barwick@gmx.net


pgsql-general by date:

Previous
From: Alejandro Javier Pomeraniec
Date:
Subject: Accent insensitive search
Next
From: Alvaro Herrera
Date:
Subject: Re: Accent insensitive search