BUG #15272: creating an index function terminate with error

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15272: creating an index function terminate with error
Дата
Msg-id 153123058927.1406.13850916810995839008@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #15272: creating an index function terminate with error  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15272
Logged by:          karim loumour
Email address:      loumour@gmail.com
PostgreSQL version: 10.4
Operating system:   RHEL 7
Description:

I created the function bellow :

CREATE OR REPLACE FUNCTION f_unaccent(text) RETURNS text AS $$
SELECT lower(unaccent('unaccent', $1))
$$  LANGUAGE sql IMMUTABLE;

I can call this function correctly :

select upper(f_unaccent(nom)) from geoname limit 10;
        upper         
----------------------
 CANAL LLISA
 TORRENT LLIMOIS
 BARRANC DEL LLEMPO
 CASA LLECSIA
 BORDA DEL LLECSIA
 PONT DEL LLARG
 FONTANAL LLARG
 CASA LLARG
 CANAL DEL LLARG
 TORRENT DE LA LLAMPA
(10 rows)

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
LINE 2: SELECT lower(unaccent('unaccent', $1))
                     ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
QUERY:  
SELECT lower(unaccent('unaccent', $1))

CONTEXT:  SQL function "f_unaccent" during inlining


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15271: Documentation / Error reporting on GUC parameter change
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15272: creating an index function terminate with error