@@ -2065,15 +2065,21 @@ psql_completion(const char *text, int start, int end)
20652065/*
20662066 * ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ]
20672067 * ANALYZE [ VERBOSE ] [ table_and_columns [, ...] ]
2068- *
2069- * Currently the only allowed option is VERBOSE, so we can be skimpier on
2070- * the option processing than VACUUM has to be.
20712068 */
20722069 else if (Matches ("ANALYZE" ))
20732070 COMPLETE_WITH_SCHEMA_QUERY (Query_for_list_of_analyzables ,
20742071 " UNION SELECT 'VERBOSE'" );
2075- else if (Matches ("ANALYZE" , "(" ))
2076- COMPLETE_WITH ("VERBOSE)" );
2072+ else if (HeadMatches ("ANALYZE" , "(*" ) &&
2073+ !HeadMatches ("ANALYZE" , "(*)" ))
2074+ {
2075+ /*
2076+ * This fires if we're in an unfinished parenthesized option list.
2077+ * get_previous_words treats a completed parenthesized option list as
2078+ * one word, so the above test is correct.
2079+ */
2080+ if (ends_with (prev_wd , '(' ) || ends_with (prev_wd , ',' ))
2081+ COMPLETE_WITH ("VERBOSE" , "SKIP_LOCKED" );
2082+ }
20772083 else if (HeadMatches ("ANALYZE" ) && TailMatches ("(" ))
20782084 /* "ANALYZE (" should be caught above, so assume we want columns */
20792085 COMPLETE_WITH_ATTR (prev2_wd , "" );
@@ -3423,7 +3429,7 @@ psql_completion(const char *text, int start, int end)
34233429 */
34243430 if (ends_with (prev_wd , '(' ) || ends_with (prev_wd , ',' ))
34253431 COMPLETE_WITH ("FULL" , "FREEZE" , "ANALYZE" , "VERBOSE" ,
3426- "DISABLE_PAGE_SKIPPING" );
3432+ "DISABLE_PAGE_SKIPPING" , "SKIP_LOCKED" );
34273433 }
34283434 else if (HeadMatches ("VACUUM" ) && TailMatches ("(" ))
34293435 /* "VACUUM (" should be caught above, so assume we want columns */
0 commit comments