Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9gwa-0004aW-1o for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:18:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y9gwZ-0005kB-Ib for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 21:18:07 +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 1Y9gwY-0005jy-SF for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:18:07 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y9gwR-0000Us-Pc for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 21:18:05 +0000 Received: by mail-la0-f51.google.com with SMTP id ms9so16532469lab.10 for ; Fri, 09 Jan 2015 13:17:57 -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=TUcfHpz3asAOcZkn00sCX46WRTLBZ9FxBy6xpKZoGbs=; b=bxCvK9d7gxC189NR/UoXRyP5eGZ9TDn6tpQB1wjXqPfyH5G1tB2jaessAUKFzw9pTm omHE2XK9r5usZpezsCJvWcyouEOk1Jz0WtBa56GrCl/RyT3i0oMf6KJ1X8xhDwYc8YAt T9AMgtqvqTZQYMb0ovIDct3MuvK4S/BHeC67RW8DJ+kdqaZ11RseMTOnHdK0YVe1Zcgi pA3ecDx2C9e50Ckh1JAfMx1yYF0FxNXljDUa9SotM30aiNzKzwn6m+VNZRUIwYp7LWKY K8b5rnwxEN3O5xscP6qgyxtGGLfKqM+Z5HJjOgTS4IH6omA2hMjY+IWHldCKvYmqD5Fj wgvA== X-Gm-Message-State: ALoCoQkFnztBqCAOMvtIdiRAMaVfoCRytIrQWdmvYOz+RQZ9HhW31Sfnc3EqJyf9ob9P5/joHV7p X-Received: by 10.152.4.233 with SMTP id n9mr24002516lan.61.1420838277691; Fri, 09 Jan 2015 13:17:57 -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 m5sm2115076lbd.8.2015.01.09.13.17.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jan 2015 13:17:57 -0800 (PST) Message-ID: <54B04581.1070906@joh.to> Date: Fri, 09 Jan 2015 22:17:53 +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 , jeff.casavant@gmail.com CC: 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> In-Reply-To: <12297.1420836142@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 21:42, Tom Lane wrote: > jeff.casavant@gmail.com writes: >> Code to reproduce: > >> create function b() returns int as $$ select 1 $$ language sql; >> create function a() returns int as $$ select b() $$ language sql; >> create schema qwr; >> create materialized view qwr.c as select a(); > > 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. 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. .marko -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs