refresh materialized view: concurrently + with no data

ZizhuanLiu X-MAN <44973863@qq.com>

From: ZizhuanLiu X-MAN <44973863@qq.com>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Cc: 我自己的邮箱 <44973863@qq.com>
Date: 2026-05-31T11:57:32Z
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@qq.com