Re: BUG #15272: creating an index function terminate with error - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15272: creating an index function terminate with error
Date
Msg-id 28790.1531231108@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15272: creating an index function terminate with error  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
=?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


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15272: creating an index function terminate with error
Next
From: PG Bug reporting form
Date:
Subject: BUG #15273: Lexer bug with UESCAPE