@@ -3981,11 +3981,26 @@ match_previous_words(int pattern_id,
3981
3981
/* CREATE MATERIALIZED VIEW */
3982
3982
else if (Matches ("CREATE" , "MATERIALIZED" ))
3983
3983
COMPLETE_WITH ("VIEW" );
3984
- /* Complete CREATE MATERIALIZED VIEW <name> with AS */
3984
+ /* Complete CREATE MATERIALIZED VIEW <name> with AS or USING */
3985
3985
else if (Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny ))
3986
+ COMPLETE_WITH ("AS" , "USING" );
3987
+
3988
+ /*
3989
+ * Complete CREATE MATERIALIZED VIEW <name> USING with list of access
3990
+ * methods
3991
+ */
3992
+ else if (Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny , "USING" ))
3993
+ COMPLETE_WITH_QUERY (Query_for_list_of_table_access_methods );
3994
+ /* Complete CREATE MATERIALIZED VIEW <name> USING <access method> with AS */
3995
+ else if (Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny , "USING" , MatchAny ))
3986
3996
COMPLETE_WITH ("AS" );
3987
- /* Complete "CREATE MATERIALIZED VIEW <sth> AS with "SELECT" */
3988
- else if (Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny , "AS" ))
3997
+
3998
+ /*
3999
+ * Complete CREATE MATERIALIZED VIEW <name> [USING <access method> ] AS
4000
+ * with "SELECT"
4001
+ */
4002
+ else if (Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny , "AS" ) ||
4003
+ Matches ("CREATE" , "MATERIALIZED" , "VIEW" , MatchAny , "USING" , MatchAny , "AS" ))
3989
4004
COMPLETE_WITH ("SELECT" );
3990
4005
3991
4006
/* CREATE EVENT TRIGGER */
0 commit comments