Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4vD2-0006an-40 for pgsql-bugs@arkaria.postgresql.org; Mon, 23 May 2016 19:08:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b4vD1-000731-Jj for pgsql-bugs@arkaria.postgresql.org; Mon, 23 May 2016 19:08:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b4vCN-0005cg-KO for pgsql-bugs@postgresql.org; Mon, 23 May 2016 19:07:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b4vCG-0002YL-5r for pgsql-bugs@postgresql.org; Mon, 23 May 2016 19:07:31 +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 u4NJ7Lug017803; Mon, 23 May 2016 15:07:21 -0400 From: Tom Lane To: lalbin@scharp.org cc: pgsql-bugs@postgresql.org, Kevin Grittner Subject: Re: BUG #14147: Restore of MatView of Foreign Data Table fails In-reply-to: <20160518160757.16249.48982@wrigleys.postgresql.org> References: <20160518160757.16249.48982@wrigleys.postgresql.org> Comments: In-reply-to lalbin@scharp.org message dated "Wed, 18 May 2016 16:07:57 -0000" Date: Mon, 23 May 2016 15:07:21 -0400 Message-ID: <17802.1464030441@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) 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 lalbin@scharp.org writes: > I have found that restoration of Materialized Views of Foreign Data Tables > where user postgres does not have a user mapping will fail. It seems that it > is trying to execute the Foreign Data Table in some way instead of reading > the Foreign Table Definition. This is another variant of a problem that's been complained of multiple times before: CREATE MATERIALIZED VIEW ... WITH NO DATA runs planning and even does ExecutorStart for the view's query, causing issues such as lack of permissions to be exposed. This breaks assorted assumptions in pg_dump and probably other places. We need to refactor things so that that does not happen. Kevin, are you planning to fix that anytime soon? 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