pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: loumour@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15272: creating an index function terminate with error
Date: Tue, 10 Jul 2018 09:58:28 -0400
Message-ID: <28790.1531231108@sss.pgh.pa.us> (raw)
In-Reply-To: <153123058927.1406.13850916810995839008@wrigleys.postgresql.org>
References: <153123058927.1406.13850916810995839008@wrigleys.postgresql.org>

=?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




view thread (2+ messages)

Message-ID: <28790.1531231108@sss.pgh.pa.us>
Permalink:  ../28790.1531231108@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28790.1531231108@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, loumour@gmail.com
  Subject: Re: BUG #15272: creating an index function terminate with error
  In-Reply-To: <28790.1531231108@sss.pgh.pa.us>
  References: <153123058927.1406.13850916810995839008@wrigleys.postgresql.org> <28790.1531231108@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox