Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit029722a

Browse files
committed
Improved tab completion for CLUSTER VERBOSE.
Jeff Janes
1 parent68386fc commit029722a

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,14 +1661,29 @@ psql_completion(char *text, int start, int end)
16611661
/* CLUSTER */
16621662

16631663
/*
1664-
* If the previous word is CLUSTER and notwithout produce list of tables
1664+
* If the previous word is CLUSTER and notWITHOUT produce list of tables
16651665
*/
16661666
elseif (pg_strcasecmp(prev_wd,"CLUSTER")==0&&
16671667
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+
elseif (pg_strcasecmp(prev_wd,"VERBOSE")==0&&
1674+
pg_strcasecmp(prev2_wd,"CLUSTER")==0)
16681675
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,NULL);
1676+
16691677
/* If we have CLUSTER <sth>, then add "USING" */
16701678
elseif (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+
elseif (pg_strcasecmp(prev3_wd,"CLUSTER")==0&&
1686+
pg_strcasecmp(prev2_wd,"VERBOSE")==0)
16721687
{
16731688
COMPLETE_WITH_CONST("USING");
16741689
}
@@ -1683,6 +1698,17 @@ psql_completion(char *text, int start, int end)
16831698
COMPLETE_WITH_QUERY(Query_for_index_of_table);
16841699
}
16851700

1701+
/*
1702+
* If we have CLUSTER VERBOSE <sth> USING, then add the index as well.
1703+
*/
1704+
elseif (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+
16861712
/* COMMENT */
16871713
elseif (pg_strcasecmp(prev_wd,"COMMENT")==0)
16881714
COMPLETE_WITH_CONST("ON");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp