Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WrZFe-0005cM-E9 for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2014 20:54:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WrZFd-0004h1-2d for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2014 20:54:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WrY5T-0001aF-Av for pgsql-bugs@postgresql.org; Mon, 02 Jun 2014 19:40:03 +0000 Received: from mail.cybercat.ca ([207.96.251.195] helo=cybercat.ca) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WrY5P-0007XD-Sf for pgsql-bugs@postgresql.org; Mon, 02 Jun 2014 19:40:01 +0000 Received: from [216.191.123.162] (account rossnick HELO versa.cybercat.priv) by cybercat.ca (CommuniGate Pro SMTP 5.2.19) with ESMTPSA id 157387732; Mon, 02 Jun 2014 15:39:59 -0400 Message-ID: <538CD30E.3030005@cybercat.ca> Date: Mon, 02 Jun 2014 15:39:58 -0400 From: Nicolas Ross User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #10500: Cannot restore from a dump when some function is used in public shcema References: <20140602161427.2797.72238@wrigleys.postgresql.org> <17970.1401732669@sss.pgh.pa.us> In-Reply-To: <17970.1401732669@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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