Re: how to ignore accents?

Поиск
Список
Период
Сортировка
От Ennio-Sr
Тема Re: how to ignore accents?
Дата
Msg-id 20050331000145.GA8344@deby.ei.hnet
обсуждение исходный текст
Ответ на how to ignore accents?  ("Celia McInnis" <celia@drmath.ca>)
Ответы Re: how to ignore accents?  (Michael Fuhr <mike@fuhr.org>)
Re: how to ignore accents?  (Jaime Casanova <systemguards@gmail.com>)
Список pgsql-novice
* Celia McInnis <celia@drmath.ca> [300305, 12:29]:
> I have French text with accents in it and would rather (for search purposes)
> be able to search for things with the accents removed. Is there any builtin
> postgres function which will do this?
>
> Here is the format of some accented (French) words in my database:
>
> fran\347ais caf\351 t\364\t br\373le r\352ver \342nes b\350gues
>
> which I want to be able to search for as:
>
> francais cafe tot brule rever anes begues
>
> Celia
>

Hi Celia,

I'm not an expert, but I'm afraid it's not possible to do that (and I'd
be glad if somebody came out saying I'm wrong as I've the same problem).
However, you can achieve a similar result using _like_ and truncating
the accented words so that only un-accented letters are searched for.

In your example, you would use:

mydb=> select * from your_table where col_title like '%franc%';
mydb=> select * from your_table where col_title like '%caf%';
mydb=> select * from your_table where col_title like '%gues%';
and so on.

Hope that helps.
Regards,
    Ennio.


--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!"  (diceva Henry Miller) ]    (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.              )=(
 Do something you aren't good at!" (as Henry Miller used to say) ]

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: rpm install issues - RHE3
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: how to ignore accents?