refresh materialized view: concurrently + with no data - Mailing list pgsql-hackers

From ZizhuanLiu X-MAN
Subject refresh materialized view: concurrently + with no data
Date
Msg-id tencent_9B39F0316D0CB41613CBDFA596F3D4238D08@qq.com
Whole thread
List 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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: vignesh C
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication