Re: BUG #15272: creating an index function terminate with error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15272: creating an index function terminate with error
Дата
Msg-id 28790.1531231108@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15272: creating an index function terminate with error  (PG Bug reporting form <noreply@postgresql.org>)
Список 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 по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15272: creating an index function terminate with error
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15273: Lexer bug with UESCAPE