disallow explain refresh matview stmt

This commit is contained in:
sqyyeah
2020-08-20 17:09:13 +08:00
parent 470d6d3175
commit 00045b7941
3 changed files with 7 additions and 1 deletions

View File

@ -12817,7 +12817,6 @@ ExplainableStmt:
| DeclareCursorStmt
| CreateAsStmt
| CreateMatViewStmt
| RefreshMatViewStmt
| ExecuteStmt /* by default all are $$=$1 */
;

View File

@ -28,6 +28,11 @@ EXPLAIN (analyze on, costs off)
--? Total runtime: .* ms
(4 rows)
EXPLAIN (analyze on, costs off)
REFRESH MATERIALIZED VIEW mvtest_tm;
ERROR: syntax error at or near "REFRESH"
LINE 2: REFRESH MATERIALIZED VIEW mvtest_tm;
^
SELECT * FROM mvtest_tm ORDER BY type;
type | totamt
------+--------

View File

@ -14,6 +14,8 @@ SELECT * FROM mvtest_tv ORDER BY type;
-- create a materialized view with no data, and confirm correct behavior
EXPLAIN (analyze on, costs off)
CREATE MATERIALIZED VIEW mvtest_tm AS SELECT type, sum(amt) AS totamt FROM mvtest_t GROUP BY type WITH NO DATA;
EXPLAIN (analyze on, costs off)
REFRESH MATERIALIZED VIEW mvtest_tm;
SELECT * FROM mvtest_tm ORDER BY type;
REFRESH MATERIALIZED VIEW mvtest_tm;
ALTER MATERIALIZED VIEW mvtest_tm set (orientation=column); --error