Comment puis-je effectuer une recherche insensible à l'accent dans Postgres 8.3.x avec une base de données dans utf-8?
-
20-08-2019 - |
Question
Essayé de sélectionner to_ascii ('capo', 'LATIN1'), to_ascii ('& # 231; apo', 'LATIN1') et les résultats sont différents ....
La solution
Regardez ici .
CREATE FUNCTION to_ascii(bytea, name)
RETURNS text STRICT AS 'to_ascii_encname' LANGUAGE internal;
et ensuite utilisez-le comme ceci:
SELECT to_ascii(convert_to('Übermeier', 'latin1'), 'latin1');
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow