Re: Translate problems

Поиск
Список
Период
Сортировка
От Manuel Sugawara
Тема Re: Translate problems
Дата
Msg-id m365zmp0zl.fsf@conexa.fciencias.unam.mx
обсуждение исходный текст
Ответ на Translate problems  (Leandro Fanzone <leandro@hasar.com>)
Список pgsql-novice
Leandro Fanzone <leandro@hasar.com> writes:

> I have a table with a text field:
>
[...]
>
> SELECT myfield FROM mytable
> WHERE TRANSLATE(LOWER(myfield), '[accented vowels collection]', '[respetive
> non-accented vowels]')

I faced the same problem and, equivalente to your approach, I used a
combination of to_ascii and upper/lower:

test=# select to_ascii('áéíóúñ');
 to_ascii
----------
 aeioun
(1 row)

create or replace function to_uascii( text ) as '
select upper(to_ascii($1)) as result
' language 'sql';

I'm wondering whatever this approach works for multibyte encodings
(UTF-8 and such).

Regards,
Manuel.

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

Предыдущее
От: Matt Price
Дата:
Сообщение: Re: web archiving
Следующее
От: Leandro Fanzone
Дата:
Сообщение: Re: Translate problems