=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> I created the function bellow :
> CREATE OR REPLACE FUNCTION f_unaccent(text) RETURNS text AS $$
> SELECT lower(unaccent('unaccent', $1))
> $$ LANGUAGE sql IMMUTABLE;
> But, when i need to create an index using that function, i have the
> following error:
> dref=# create index geo_test on geoname(upper(f_unaccent(nom))) ;
> ERROR: function unaccent(unknown, text) does not exist
You need to schema-qualify the function name, or else add a SET clause
to force an appropriate search_path setting. PG did not use to be
picky about that, but it is since CVE-2018-1058. In any case, the
old behavior was very dangerous since the index function's behavior
could vary depending on the prevailing search path.
regards, tom lane