Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJhBO-0006I4-BS for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 14:48:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJhBN-0005UQ-Og for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 14:48:21 +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 1eJhBN-0005UF-Dz for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2017 14:48:21 +0000 Received: from mailgw13.skno.se ([192.121.255.213] helo=sknomailgw.skno.se) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJhBI-0006YR-V8 for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2017 14:48:19 +0000 Received: from Mail1.kristianstad.se (mailout.kristianstad.se [193.17.67.3]) by sknomailgw.skno.se with ESMTP id vASEmDpb024481-vASEmDpd024481 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128 verify=CAFAIL); Tue, 28 Nov 2017 15:48:13 +0100 Received: from Mail1.kristianstad.se (10.10.32.51) by Mail1.kristianstad.se (10.10.32.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Tue, 28 Nov 2017 15:48:13 +0100 Received: from Mail1.kristianstad.se ([fe80::a040:7fb7:5e7e:8672]) by Mail1.kristianstad.se ([fe80::a040:7fb7:5e7e:8672%6]) with mapi id 15.01.1261.035; Tue, 28 Nov 2017 15:48:13 +0100 From: Henrik Uggla To: Tom Lane CC: "pgsql-general@lists.postgresql.org" Subject: SV: Refreshing materialized views Thread-Topic: Refreshing materialized views Thread-Index: AQHTaFJ11SlexC7Chke0pfLwYbUTeKMpyCiAgAAUu/E= Date: Tue, 28 Nov 2017 14:48:12 +0000 Message-ID: References: <9240031180ff4c419251652f39908dd0@kristianstad.se>,<13279.1511879147@sss.pgh.pa.us> In-Reply-To: <13279.1511879147@sss.pgh.pa.us> Accept-Language: sv-SE, en-US Content-Language: sv-SE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.32.46] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk The underlying tables are foreign tables. The user has been mapped to a for= eign user with select permission. I have no problem selecting from the fore= ign tables or the materialized views. This is the error in the log (not very useful): 2017-11-28 13:58:03.207 UTC [347] STATEMENT: REFRESH MATERIALIZED VIEW kus= t_havsplan.fornlamning_linje WITH DATA; 2017-11-28 13:58:47.412 UTC [296] ERROR: permission denied for relation fo= rnlamning_linje Regards Henrik ________________________________________ Fr=E5n: Tom Lane Skickat: den 28 november 2017 15:25:47 Till: Henrik Uggla Kopia: pgsql-general@lists.postgresql.org =C4mne: Re: Refreshing materialized views Henrik Uggla writes: > I created some materialized views and set a group as owner. My problem is= that I can't refresh the views. I get "permission denied" even when using = the postgres super user. If I change the owner to an ordinary user I still = can't refresh the view as the owner or postgres. Only if I change owner to = postgres am I able to refresh the view, but only as the postgres user. I've= mainly tried with Pgadmin4 but also a few times with psql, and the databas= e is installed as a docker container. Please help. Apparently, the view owner lacks select permission on some underlying table. Pay attention to what is being denied access to. regards, tom lane