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