1
I need to conduct a city search.
In the database is registered for example, São Paulo
, Viamão
, Curitiba
, but if the user tries to search the city of São Paulo
for example by typing Sao Paulo
(without accentuation), nothing is found because the bank is registered with accentuation.
I tried the following:
select Municipio.descricao
from municipios as Municipio
where Municipio.descricao ilike '%Sao Paulo%'
Does anyone know how to do this research ignoring the accent registered in the bank?
...Where Municipio.Descricao ilike '%Sao Paulo%' collate utf8_general_ci
– user60252
happens this
ERROR: collation "utf8_general_ci" for encoding "UTF8" does not exist
– Marcos Henzel
COLLATE Latin1_general_ci_ai Like '%Sao Paulo%' COLLATE Latin1_general_ci_ai
– user60252
Same thing, from the mistake in
COLLATE
:ERROR: collation "latin1_general_ci_ai" for encoding "UTF8" does not exist
– Marcos Henzel
I did a job you solved, I’ll post the answer, but thank you for trying.
– Marcos Henzel
@Leocaracciolo This collation is for Mysql, this question is Postgresql
– Clodoaldo Neto
Oh yes, so it didn’t work, thanks @Clodoaldoneto
– Marcos Henzel
sorry, I didn’t notice :) Clodoaldo Neto
– user60252