Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fctA3-0003mL-Tl for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Jul 2018 13:58:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fctA1-0002TI-IY for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Jul 2018 13:58:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fctA1-0002TA-Cj for pgsql-bugs@lists.postgresql.org; Tue, 10 Jul 2018 13:58:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fct9y-0004Bk-QV for pgsql-bugs@lists.postgresql.org; Tue, 10 Jul 2018 13:58:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w6ADwSBO028791; Tue, 10 Jul 2018 09:58:28 -0400 From: Tom Lane To: loumour@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15272: creating an index function terminate with error In-reply-to: <153123058927.1406.13850916810995839008@wrigleys.postgresql.org> References: <153123058927.1406.13850916810995839008@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Tue, 10 Jul 2018 13:49:49 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28789.1531231108.1@sss.pgh.pa.us> Date: Tue, 10 Jul 2018 09:58:28 -0400 Message-ID: <28790.1531231108@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= 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