Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y9gOC-0003LI-CT for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 20:42:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y9gOB-0001GY-Lu for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jan 2015 20:42:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y9gO9-0001EA-AZ for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 20:42:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y9gO2-0006PZ-3C for pgsql-bugs@postgresql.org; Fri, 09 Jan 2015 20:42:32 +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 t09KgM3M012298; Fri, 9 Jan 2015 15:42:22 -0500 From: Tom Lane To: jeff.casavant@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12465: Materialized view dump restoration issue In-reply-to: <20150108212429.11502.18220@wrigleys.postgresql.org> References: <20150108212429.11502.18220@wrigleys.postgresql.org> Comments: In-reply-to jeff.casavant@gmail.com message dated "Thu, 08 Jan 2015 21:24:29 +0000" Date: Fri, 09 Jan 2015 15:42:22 -0500 Message-ID: <12297.1420836142@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 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. You could fix it by schema-qualifying b in the text of a, or by adding a "SET schema_path" clause to a. 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