@@ -491,6 +491,7 @@ static void check_expressions_in_partition_key(PartitionSpec *spec, core_yyscan_
491491
492492%type <range> OptTempTableName
493493%type <into> into_clause create_as_target create_mv_target
494+ %type <boolean> incremental
494495
495496%type <defelt> createfunc_opt_item common_func_opt_item dostmt_opt_item
496497%type <fun_param> func_arg func_arg_with_default table_func_column aggr_arg
@@ -769,7 +770,7 @@ static void check_expressions_in_partition_key(PartitionSpec *spec, core_yyscan_
769770 HANDLER HAVING HEADER_P HOLD HOUR_P
770771
771772 IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE
772- INCLUDING INCREMENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
773+ INCLUDING INCREMENT INCREMENTAL INDEX INDEXES INHERIT INHERITS INITIALLY INLINE_P
773774 INNER_P INOUT INPUT_P INSENSITIVE INSERT INSTEAD INT_P INTEGER
774775 INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION
775776
@@ -6839,31 +6840,33 @@ ext_opt_encoding_item:
68396840 *****************************************************************************/
68406841
68416842CreateMatViewStmt:
6842- CREATE OptNoLog MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data OptDistributedBy
6843+ CREATE OptNoLog incremental MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data OptDistributedBy
68436844 {
68446845 CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt);
6845- ctas->query = $7 ;
6846- ctas->into = $5 ;
6846+ ctas->query = $8 ;
6847+ ctas->into = $6 ;
68476848 ctas->objtype = OBJECT_MATVIEW;
68486849 ctas->is_select_into = false;
68496850 ctas->if_not_exists = false;
68506851 /* cram additional flags into the IntoClause */
6851- $5->rel->relpersistence = $2;
6852- $5->skipData = !($8);
6853- ctas->into->distributedBy = $9;
6852+ $6->rel->relpersistence = $2;
6853+ $6->skipData = !($9);
6854+ $6->ivm = $3;
6855+ ctas->into->distributedBy = $10;
68546856 $$ = (Node *) ctas;
68556857 }
6856- | CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data
6858+ | CREATE OptNoLog incremental MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data
68576859 {
68586860 CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt);
6859- ctas->query = $10 ;
6860- ctas->into = $8 ;
6861+ ctas->query = $11 ;
6862+ ctas->into = $9 ;
68616863 ctas->objtype = OBJECT_MATVIEW;
68626864 ctas->is_select_into = false;
68636865 ctas->if_not_exists = true;
68646866 /* cram additional flags into the IntoClause */
6865- $8->rel->relpersistence = $2;
6866- $8->skipData = !($11);
6867+ $9->rel->relpersistence = $2;
6868+ $9->skipData = !($12);
6869+ $9->ivm = $3;
68676870 $$ = (Node *) ctas;
68686871 }
68696872 ;
@@ -6880,11 +6883,16 @@ create_mv_target:
68806883 $$->tableSpaceName = $5;
68816884 $$->viewQuery = NULL; /* filled at analysis time */
68826885 $$->skipData = false; /* might get changed later */
6886+ $$->ivm = false;
68836887
68846888 $$->accessMethod = greenplumLegacyAOoptions($$->accessMethod, &$$->options);
68856889 }
68866890 ;
68876891
6892+ incremental: INCREMENTAL { $$ = true; }
6893+ | /*EMPTY*/ { $$ = false; }
6894+ ;
6895+
68886896OptNoLog: UNLOGGED { $$ = RELPERSISTENCE_UNLOGGED; }
68896897 | /*EMPTY*/ { $$ = RELPERSISTENCE_PERMANENT; }
68906898 ;
@@ -18794,6 +18802,7 @@ unreserved_keyword:
1879418802 | INCLUDING
1879518803 | INCLUSIVE
1879618804 | INCREMENT
18805+ | INCREMENTAL
1879718806 | INDEX
1879818807 | INDEXES
1879918808 | INHERIT
@@ -19730,6 +19739,7 @@ bare_label_keyword:
1973019739 | INCLUDING
1973119740 | INCLUSIVE
1973219741 | INCREMENT
19742+ | INCREMENTAL
1973319743 | INDEX
1973419744 | INDEXES
1973519745 | INHERIT
0 commit comments