how to make text fields accent insensitive?

Поиск
Список
Период
Сортировка
От Heine Ferreira
Тема how to make text fields accent insensitive?
Дата
Msg-id CAMuqQjcnC+SgJoHFxTLP-ZqWYiMiGA2fJVNERTXwB1V_5vxvSQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi

Recently you answered my question on how to make a field case insensitive.
You showed me how to do it with the extension and data type citext.

How do I make the same field accent insensitive as well?
I managed to install the extension "unaccent" in Postgres 9.1.2
using create extension. Unfortunately I could only use it in the where clauses
of sql statements. I want to make a field behave accent insensitive during
comparisons just like citext does for case insensitive.

The reason I want to do this is because it's one of the options I am used to in
Microsoft SQL Server. I can do something like this:

select * from table1 where unaccent(field1)='John';

I can also do this:

select * from table1 where unaccent(field1)::citext='JohN';

But I want field1 to have this a default behaviour?

Thanks

H.F.

В списке pgsql-general по дате отправления:

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: On duplicate ignore
Следующее
От: Willem Buitendyk
Дата:
Сообщение: Re: Cannot connect remotely to postgresql