Re: Accent insensitive search

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: Accent insensitive search
Дата
Msg-id 200307012139.08201.barwick@gmx.net
обсуждение исходный текст
Ответ на Accent insensitive search  (Alejandro Javier Pomeraniec <apomeraniec@buenosaires.gov.ar>)
Список 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 по дате отправления:

Предыдущее
От: Alejandro Javier Pomeraniec
Дата:
Сообщение: Accent insensitive search
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Accent insensitive search