refresh materialized view: concurrently + with no data

From: ZizhuanLiu X-MAN <44973863(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: 我自己的邮箱 <44973863(at)qq(dot)com>
Subject: refresh materialized view: concurrently + with no data
Date: 2026-05-31 11:57:32
Message-ID: tencent_9B39F0316D0CB41613CBDFA596F3D4238D08@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Hackers,
`
When executing the command below:
&nbsp; &nbsp; refresh materialized view concurrently MY_MATVIEW_2 with no data;
PostgreSQL throws the following error:
&nbsp; &nbsp; ERROR: &nbsp;REFRESH options CONCURRENTLY and WITH NO DATA cannot be used together.
`
I noticed that this error is reported in the executor within RefreshMatViewByOid(),&nbsp;
rather than being checked earlier during parsing in gram.y when building RefreshMatViewStmt.&nbsp;
We can simply detect the conflict between n-&gt;concurrent and n-&gt;skipData at parse time.
`
I’m curious whether this is a deliberate convention for PostgreSQL utility commands:&nbsp;
&nbsp; allowing conflicting option combinations to pass the parser, and deferring validity checks until executor execution?
`
Any clarification is appreciated.
`
`
Thanks,
--
ZizhuanLiu&nbsp;(X-MAN)&nbsp;
44973863(at)qq(dot)com

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-05-31 12:08:05 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Amit Kapila 2026-05-31 11:54:08 Re: Proposal: Conflict log history table for Logical Replication