Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS2oy-0000pB-HJ for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Jul 2016 13:54:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bS2oy-0006C6-10 for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Jul 2016 13:54:56 +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 1bS2oJ-0004m2-Q5 for pgsql-bugs@postgresql.org; Tue, 26 Jul 2016 13:54:15 +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 1bS2oH-0004RJ-4p for pgsql-bugs@postgresql.org; Tue, 26 Jul 2016 13:54:14 +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 u6QDsA01005851; Tue, 26 Jul 2016 09:54:10 -0400 From: Tom Lane To: Kevin Grittner cc: Peter Eisentraut , Michael Paquier , 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> <1152.1466094507@sss.pgh.pa.us> <21147.1467052547@sss.pgh.pa.us> <9af4bc32-7e55-a21d-47e7-608582a8c48d@2ndquadrant.com> Comments: In-reply-to Kevin Grittner message dated "Tue, 26 Jul 2016 07:22:53 -0500" Date: Tue, 26 Jul 2016 09:54:10 -0400 Message-ID: <5850.1469541250@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) 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 Kevin Grittner writes: > So you are suggesting that restoring from pg_dump output should > generate materialized view data under a different security context > than would be used by a REFRESH statement on the source database? Yes. Consider the following simple example (done by a non-superuser named joe): create table joes_table(f1 int); insert into joes_table values(1); revoke insert on joes_table from joe; pg_dump is required to be able to restore the state of this table correctly. It will fail to do so if it issues the revoke before loading data. The same issue applies to all data loading, including refreshing matviews. 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