Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9hSN-0005n8-B3 for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:50:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y9hSL-0004qz-Bn for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:50:57 +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 1Y9hSJ-0004qk-7E for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:50:55 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y9hSF-00018l-6O for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:50:53 +0000 Received: by mail-la0-f43.google.com with SMTP id s18so16668927lam.2 for ; Fri, 09 Jan 2015 13:50:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1gGfLcbI7Yu8y6LgoVU/CJJJiOwdS0KuXWd38fFFqZ4=; b=m8MHE00ZaNWkcz+7kQYislFxBma7VFtdI8i4JF62Iab/nTNUjGB2j4wE1X0aB5NnKM h3Jf0sxNtUHW9mjCYGX8feEOuoYhxhupbFCyGSC4jwIO3dB1Nf6gim6KScQ2/QdVhEfX rCbHAqpbT/1akFZUlrErL1s3i7XuYXPNShQF8hDrUEy+SoU2fYhmajOIKBCZcYU4+ZBu 5kl4XYZLoujD+MBn099KnL8s4YVEOhoBJ9t0+DySXK01qZcnjIBfSpAdv8g7wol2KLR8 eHhTrSoRxL3LfPRWNQmMaGQUFBnTZycq7GiTaZUn+8fFCSvOTGfr3+fDF05QCkO/g3Lk dXrg== X-Gm-Message-State: ALoCoQmgdFfRzHEIxllexkHip2xGbdamzJQnjeljxRzg2xY/Rm54wmyGAndpIYhLF28QidC5LvWa X-Received: by 10.112.170.36 with SMTP id aj4mr23818753lbc.3.1420840249011; Fri, 09 Jan 2015 13:50:49 -0800 (PST) Received: from [172.20.10.2] (c-5eeaaaa7-74736162.cust.telenor.se. [94.234.170.167]) by mx.google.com with ESMTPSA id wv5sm2128774lbb.20.2015.01.09.13.50.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jan 2015 13:50:48 -0800 (PST) Message-ID: <54B04D34.4000309@joh.to> Date: Fri, 09 Jan 2015 22:50:44 +0100 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Tom Lane CC: jeff.casavant@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12465: Materialized view dump restoration issue References: <20150108212429.11502.18220@wrigleys.postgresql.org> <12297.1420836142@sss.pgh.pa.us> <54B04581.1070906@joh.to> <13445.1420839491@sss.pgh.pa.us> In-Reply-To: <13445.1420839491@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 On 2015-01-09 22:38, Tom Lane wrote: > 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@ ... Yup, and now it's not inlineable anymore. >> 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. Hmm.. So I guess this is pretty much impossible as long as we insist on the materialized views being initialized at restore time. (Though I notice that even WITH NO DATA does not work.) .marko -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs