Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJhek-0000EQ-RY for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 15:18:42 +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 1eJhek-0007GO-4W for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 15:18:42 +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 1eJhej-0007GF-TF for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2017 15:18:41 +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.89) (envelope-from ) id 1eJheg-00046a-Vr for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2017 15:18:41 +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 vASFIZUe023155; Tue, 28 Nov 2017 10:18:35 -0500 From: Tom Lane To: Henrik Uggla cc: "pgsql-general@lists.postgresql.org" Subject: Re: SV: Refreshing materialized views In-reply-to: References: <9240031180ff4c419251652f39908dd0@kristianstad.se>,<13279.1511879147@sss.pgh.pa.us> Comments: In-reply-to Henrik Uggla message dated "Tue, 28 Nov 2017 14:48:12 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23153.1511882315.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Nov 2017 10:18:35 -0500 Message-ID: <23154.1511882315@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Henrik Uggla writes: > The underlying tables are foreign tables. The user has been mapped to a = foreign user with select permission. I have no problem selecting from the = foreign tables or the materialized views. [ shrug... ] WFM; if I can select from the foreign table then I can make a materialized view that selects from it, and that refreshes without complaint. Admittedly, getting things set up to select from the foreign table is trickier than it sounds: your local user needs SELECT on the foreign table plus a mapping to some remote userid, and *on the remote server* that remote userid needs SELECT on whatever the foreign table is referencing. I'm guessing you messed up one of these components. regards, tom lane