Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9hGB-0005Ku-Mt for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:38:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y9hGB-0002BI-3H for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:38:23 +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 1Y9hGA-0002BB-2U for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:38:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y9hG3-0000rW-3C for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:38:20 +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 t09LcBW1013446; Fri, 9 Jan 2015 16:38:11 -0500 From: Tom Lane To: Marko Tiikkaja cc: jeff.casavant@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12465: Materialized view dump restoration issue In-reply-to: <54B04581.1070906@joh.to> References: <20150108212429.11502.18220@wrigleys.postgresql.org> <12297.1420836142@sss.pgh.pa.us> <54B04581.1070906@joh.to> Comments: In-reply-to Marko Tiikkaja message dated "Fri, 09 Jan 2015 22:17:53 +0100" Date: Fri, 09 Jan 2015 16:38:11 -0500 Message-ID: <13445.1420839491@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Marko Tiikkaja writes: > On 2015-01-09 21:42, Tom Lane wrote: >> This is not a pg_dump bug, this is a broken definition of function a(). >> That function will fail in any context where the caller changes >> search_path, not only pg_dump. You can perhaps get away without that >> in a single-schema database, but not with multiple schemas. > AFAIK there isn't a way to write inlineable SQL functions in relocatable > extensions in that way, since you don't know which schema they end up > installed in. The original test case comes from PostGIS. You can do it for relocatable-at-install-time extensions, as suggested in the manual: CREATE FUNCTION ... SET search_path = @extschema@ ... > But I think the bigger problem is that naively thinking it shouldn't be > this easy to create unrestorable databases. But perhaps I'm being > overly naive. Well, if you know how to inform pg_dump what random assumptions about search_path exist in the functions invoked by a matview (or expression index, or some other cases), let me know. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs