@@ -1661,14 +1661,29 @@ psql_completion(char *text, int start, int end)
1661
1661
/* CLUSTER */
1662
1662
1663
1663
/*
1664
- * If the previous word is CLUSTER and not without produce list of tables
1664
+ * If the previous word is CLUSTER and not WITHOUT produce list of tables
1665
1665
*/
1666
1666
else if (pg_strcasecmp (prev_wd , "CLUSTER" ) == 0 &&
1667
1667
pg_strcasecmp (prev2_wd , "WITHOUT" ) != 0 )
1668
+ COMPLETE_WITH_SCHEMA_QUERY (Query_for_list_of_tables , "UNION SELECT 'VERBOSE'" );
1669
+
1670
+ /*
1671
+ * If the previous words are CLUSTER VERBOSE produce list of tables
1672
+ */
1673
+ else if (pg_strcasecmp (prev_wd , "VERBOSE" ) == 0 &&
1674
+ pg_strcasecmp (prev2_wd , "CLUSTER" ) == 0 )
1668
1675
COMPLETE_WITH_SCHEMA_QUERY (Query_for_list_of_tables , NULL );
1676
+
1669
1677
/* If we have CLUSTER <sth>, then add "USING" */
1670
1678
else if (pg_strcasecmp (prev2_wd , "CLUSTER" ) == 0 &&
1671
- pg_strcasecmp (prev_wd , "ON" ) != 0 )
1679
+ pg_strcasecmp (prev_wd , "ON" ) != 0 &&
1680
+ pg_strcasecmp (prev_wd , "VERBOSE" ) != 0 )
1681
+ {
1682
+ COMPLETE_WITH_CONST ("USING" );
1683
+ }
1684
+ /* If we have CLUSTER VERBOSE <sth>, then add "USING" */
1685
+ else if (pg_strcasecmp (prev3_wd , "CLUSTER" ) == 0 &&
1686
+ pg_strcasecmp (prev2_wd , "VERBOSE" ) == 0 )
1672
1687
{
1673
1688
COMPLETE_WITH_CONST ("USING" );
1674
1689
}
@@ -1683,6 +1698,17 @@ psql_completion(char *text, int start, int end)
1683
1698
COMPLETE_WITH_QUERY (Query_for_index_of_table );
1684
1699
}
1685
1700
1701
+ /*
1702
+ * If we have CLUSTER VERBOSE <sth> USING, then add the index as well.
1703
+ */
1704
+ else if (pg_strcasecmp (prev4_wd , "CLUSTER" ) == 0 &&
1705
+ pg_strcasecmp (prev3_wd , "VERBOSE" ) == 0 &&
1706
+ pg_strcasecmp (prev_wd , "USING" ) == 0 )
1707
+ {
1708
+ completion_info_charp = prev2_wd ;
1709
+ COMPLETE_WITH_QUERY (Query_for_index_of_table );
1710
+ }
1711
+
1686
1712
/* COMMENT */
1687
1713
else if (pg_strcasecmp (prev_wd , "COMMENT" ) == 0 )
1688
1714
COMPLETE_WITH_CONST ("ON" );
0 commit comments