Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDaAK-0007Am-Ie for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jun 2016 16:29: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 1bDaAJ-0006kI-6G for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jun 2016 16:29:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDa9f-00062k-Hf for pgsql-bugs@postgresql.org; Thu, 16 Jun 2016 16:28:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDa9d-0005s3-3s for pgsql-bugs@postgresql.org; Thu, 16 Jun 2016 16:28:30 +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 u5GGSRNt001153; Thu, 16 Jun 2016 12:28:27 -0400 From: Tom Lane To: Michael Paquier cc: marian.krucina@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #13907: Restore materialized view throw permission denied In-reply-to: References: <20160202161407.2778.24659@wrigleys.postgresql.org> <22633.1465910990@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Thu, 16 Jun 2016 16:28:45 +0900" Date: Thu, 16 Jun 2016 12:28:27 -0400 Message-ID: <1152.1466094507@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 Michael Paquier writes: > So, I have been able to build the attached WIP patch proving that this > is able to work correctly. There is no real refactoring done yet, but > this passes regression tests and tutti-quanti. By the way, there are > three points I am wondering about: > 1) EXPLAIN ANALYZE is able to work with CTAS and create matview. I am > thinking that it would be better not to touch those to not impact > existing applications. By that I mean that EXPLAIN CREATE MATVIEW WITH > NO DATA would still run the planner and executor in explain.c Agreed, that needs to not break. > 2) CTAS has a WITH NO DATA option, and it would be really weird to use > the planner/executor code path when this option is used for this case. > So I'd like to use the same method for both matviews and normal > relations to simplify things and make the code more consistent. Seems reasonable, depending on how invasive you have to be. > 3) In this WIP patch, the command tag is CREATE MATERIALIZED VIEW if > WITH NO DATA is used. I am planning to use SELECT 0 in all cases to > keep things consistent with what is on HEAD and back-branches. Meh, can't get excited about that. If it's easy, okay, but arguably the current behavior is just an implementation artifact itself. I wouldn't go far out of your way to keep it. 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