@@ -877,6 +877,7 @@ typedef struct
877877#define THING_NO_SHOW (THING_NO_CREATE | THING_NO_DROP)
878878
879879static const pgsql_thing_t words_after_create []= {
880+ {"ACCESS METHOD" ,NULL ,NULL },
880881{"AGGREGATE" ,NULL ,& Query_for_list_of_aggregates },
881882{"CAST" ,NULL ,NULL },/* Casts have complex structures for names, so
882883 * skip it */
@@ -1977,6 +1978,17 @@ psql_completion(const char *text, int start, int end)
19771978COMPLETE_WITH_LIST5 ("HEADER" ,"QUOTE" ,"ESCAPE" ,"FORCE QUOTE" ,
19781979"FORCE NOT NULL" );
19791980
1981+ /* CREATE ACCESS METHOD */
1982+ /* Complete "CREATE ACCESS METHOD <name>" */
1983+ else if (Matches4 ("CREATE" ,"ACCESS" ,"METHOD" ,MatchAny ))
1984+ COMPLETE_WITH_CONST ("TYPE" );
1985+ /* Complete "CREATE ACCESS METHOD <name> TYPE" */
1986+ else if (Matches5 ("CREATE" ,"ACCESS" ,"METHOD" ,MatchAny ,"TYPE" ))
1987+ COMPLETE_WITH_CONST ("INDEX" );
1988+ /* Complete "CREATE ACCESS METHOD <name> TYPE <type>" */
1989+ else if (Matches6 ("CREATE" ,"ACCESS" ,"METHOD" ,MatchAny ,"TYPE" ,MatchAny ))
1990+ COMPLETE_WITH_CONST ("HANDLER" );
1991+
19801992/* CREATE DATABASE */
19811993else if (Matches3 ("CREATE" ,"DATABASE" ,MatchAny ))
19821994COMPLETE_WITH_LIST9 ("OWNER" ,"TEMPLATE" ,"ENCODING" ,"TABLESPACE" ,
@@ -2263,6 +2275,7 @@ psql_completion(const char *text, int start, int end)
22632275else if (Matches3 ("DROP" ,
22642276"COLLATION|CONVERSION|DOMAIN|EXTENSION|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW" ,
22652277MatchAny )||
2278+ Matches4 ("DROP" ,"ACCESS" ,"METHOD" ,MatchAny )||
22662279 (Matches4 ("DROP" ,"AGGREGATE|FUNCTION" ,MatchAny ,MatchAny )&&
22672280ends_with (prev_wd ,')' ))||
22682281Matches4 ("DROP" ,"EVENT" ,"TRIGGER" ,MatchAny )||