Problems when using unaccent

Started by PG Bug reporting formover 2 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/unaccent.html
Description:

I'm trying to query a database with unaccent, but PostgreSQL gives me
exceptions:

ERROR: function unaccent(character varying) does not exist at character
139
HINT: No function matches the given name and argument types. You might need
to add explicit type casts.
STATEMENT: SELECT "cidades"."id", "cidades"."nome", "cidades"."populacao",
"cidades"."estado_id", "cidades"."complemento" FROM "cidades" WHERE
UPPER(UNACCENT("cidades"."nome")::text) LIKE '%' ||
UPPER(REPLACE(REPLACE(REPLACE((UNACCENT('ara')), E'\\', E'\\\\'), E'%',
E'\\%'), E'_', E'\\_')) || '%' ORDER BY "cidades"."nome" ASC LIMIT 21

This query is being generated according to parameters passed by Django.
Example:

cidades.filter(**{'nome__unaccent__icontains': termo_selecao_cidade})

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Problems when using unaccent

PG Doc comments form <noreply@postgresql.org> writes:

I'm trying to query a database with unaccent, but PostgreSQL gives me
exceptions:

ERROR: function unaccent(character varying) does not exist at character
139

It looks like you haven't installed the unaccent extension in that
database. See

https://www.postgresql.org/docs/current/contrib.html

regards, tom lane