pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nicolas Ross <nicolas@cybercat.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #10500: Cannot restore from a dump when some function is used in public shcema
Date: Mon, 02 Jun 2014 15:39:58 -0400
Message-ID: <538CD30E.3030005@cybercat.ca> (raw)
In-Reply-To: <17970.1401732669@sss.pgh.pa.us>
References: <20140602161427.2797.72238@wrigleys.postgresql.org>
	<17970.1401732669@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Tom Lane a écrit :

>> I narrow it down to this simple exemple. Here's a pg_dump in plain text of
>> my test case :
>> CREATE SCHEMA intranet;
>> CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
>> SET search_path = public, pg_catalog;
>> CREATE FUNCTION cyunaccent(character varying) RETURNS character varying
>>      LANGUAGE sql IMMUTABLE
>>      AS $_$ SELECT unaccent(lower($1)); $_$;
> This function is unsafe on its face: it does not specify what schema to
> find unaccent() in.  You need to either explicitly schema-qualify:
>
>       SELECT public.unaccent(lower($1));
>
> (for good measure it'd be wise to qualify lower() as well), or else attach
> a "SET search_path" clause to the function definition.
>
> It's arguable whether the search path sensitivity of such functions is
> a feature or a bug.  But there are people depending on the fact that they
> can change the search path and get different results, so it's unlikely
> we'd change the definition now.
>
> 			regards, tom lane
Oh !

Thanks for pointing that out. I modified my function definition and now 
my restore can complete without an error.

Regards,


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)

Message-ID: <538CD30E.3030005@cybercat.ca>
Permalink:  ../538CD30E.3030005@cybercat.ca/
Also on:    postgresql.org/message-id/538CD30E.3030005@cybercat.ca

 · 

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: nicolas@cybercat.ca, tgl@sss.pgh.pa.us
  Subject: Re: BUG #10500: Cannot restore from a dump when some function is used in public shcema
  In-Reply-To: <538CD30E.3030005@cybercat.ca>
  References: <20140602161427.2797.72238@wrigleys.postgresql.org> <17970.1401732669@sss.pgh.pa.us> <538CD30E.3030005@cybercat.ca>

* 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