Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjoxw-0086HA-Kg for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Mar 2024 23:21:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rjoxv-002R8i-82 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Mar 2024 23:21:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjoxu-002R8a-WB for pgsql-bugs@lists.postgresql.org; Mon, 11 Mar 2024 23:21:55 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjoxr-0041kv-JB for pgsql-bugs@lists.postgresql.org; Mon, 11 Mar 2024 23:21:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2024011501; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=6cXSnhWi5Vy7d96eiOdROjf2YV5zltrtYKEmYQQ2KLU=; b=GAMQt 0bG5iP6hhfGWSjU2pudAMhQWBwQy49MVlx6Cmr3ZNoyZ5QokkZlxsMkaMjIe2U423++wMf88/YkLI hR5MQLdEijvgK6PviXJ3M8HeNzFplXBQmdZQk5LPal5EXO/+6OCMnQRLlciYl0rs8BJT6YmL/vjnD JrhtZU+cDh7z9HqFTwih8chYTlqSdEVThNoUpyAbEZoBfu+VVAUZo9fazn5eaD2TvF1VeXbIGLtrG qQwD45dPXgZulALvvTZcE0fwvQ11/su4VXQkUPKL9Zl+9pqNT+273s8IPuRO6PffxpiHC8HKaIdvo q1ahDK48OJsv5zaGIxCA2xh8N70Sg==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1rjoxq-000N1M-2g; Mon, 11 Mar 2024 19:21:50 -0400 Date: Mon, 11 Mar 2024 19:21:50 -0400 From: Bruce Momjian To: Heikki Linnakangas Cc: maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18387: Erroneous permission checks and/or misleading error messages with refresh materialized view Message-ID: References: <18387-12041858d9efb6f6@postgresql.org> <36bb333d-13ec-4f8e-af33-48249ca2fe69@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36bb333d-13ec-4f8e-af33-48249ca2fe69@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 12, 2024 at 01:02:16AM +0200, Heikki Linnakangas wrote: > On 11/03/2024 22:10, PG Bug reporting form wrote: > > Reproducer log (starting from interesting part): > > test=# REFRESH MATERIALIZED VIEW CONCURRENTLY test_mv; > > REFRESH MATERIALIZED VIEW > > test=# alter materialized view test_mv owner to test_role; > > ALTER MATERIALIZED VIEW > > test=# REFRESH MATERIALIZED VIEW CONCURRENTLY test_mv; > > ERROR: permission denied for table test > > --what??? N1 > > > > --check that im not hallucinating > > test=# select * from test; > > val > > ----- > > 1 > > (1 row) > > So far, this is working correctly. REFRESH MATERIALIZED VIEW runs with the > permissions of the materialized view's owner. In this case, the owner is > 'test_role', which doesn't have select permission on the table. Can we do a better job of suggesting the cause of the failure? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.