Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRjXN-0002Oc-HF for pgsql-general@arkaria.postgresql.org; Wed, 31 Mar 2021 22:42:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRjXM-0002kX-Dm for pgsql-general@arkaria.postgresql.org; Wed, 31 Mar 2021 22:42:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRjXM-0002kQ-67 for pgsql-general@lists.postgresql.org; Wed, 31 Mar 2021 22:42:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRjXK-0003QB-7y for pgsql-general@lists.postgresql.org; Wed, 31 Mar 2021 22:42:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12VMg5oj3337913; Wed, 31 Mar 2021 18:42:05 -0400 From: Tom Lane To: Tim Clarke cc: "pgsql-general@lists.postgresql.org" Subject: Re: accessing cross-schema materialized views In-reply-to: <76fe4f3e-5e91-3199-0f70-5f20ba1e142a@minerva.info> References: <76fe4f3e-5e91-3199-0f70-5f20ba1e142a@minerva.info> Comments: In-reply-to Tim Clarke message dated "Wed, 31 Mar 2021 22:31:38 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3337911.1617230525.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 31 Mar 2021 18:42:05 -0400 Message-ID: <3337912.1617230525@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tim Clarke writes: > We have: > create materialized view schema1.matview..... > grant select on table schema1.matview to mygroup > create view schema2.usingview as select ... from schema1.matview > grant select on table schema2.using to mygroup > and yet we receive "permission denied for materialized view" on a user w= ith the mygroup role selecting from schema2.usingview? The owner of the schema2.usingview is the one who must have privilege to read the underlying schema1.matview. Our permissions messages are, I fear, frequently not very good about saying whose privileges were checked. regards, tom lane