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

Commitb1bfb28

Browse files
committed
psql: Improve CREATE INDEX CONCURRENTLY tab completion
The completion of CREATE INDEX CONCURRENTLY was lacking in several wayscompared to a plain CREATE INDEX command:- CREATE INDEX <name> ON completes table names, but didn't with CONCURRENTLY.- CREATE INDEX completes ON and existing index names, but with CONCURRENTLY it only completed ON.- CREATE INDEX <name> completes ON, but didn't with CONCURRENTLY.These are now all fixed.
1 parentbc56d58 commitb1bfb28

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,15 +2005,17 @@ psql_completion(const char *text, int start, int end)
20052005
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
20062006
" UNION SELECT 'ON'"
20072007
" UNION SELECT 'CONCURRENTLY'");
2008-
/* Complete ... INDEX [<name>] ON with a list of tables */
2009-
elseif (TailMatches3("INDEX",MatchAny,"ON")||
2008+
/* Complete ... INDEX|CONCURRENTLY [<name>] ON with a list of tables */
2009+
elseif (TailMatches3("INDEX|CONCURRENTLY",MatchAny,"ON")||
20102010
TailMatches2("INDEX|CONCURRENTLY","ON"))
20112011
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tm,NULL);
2012-
/*If we have CREATE|UNIQUEINDEX CONCURRENTLY, then add"ON" */
2012+
/*Complete ...INDEX CONCURRENTLY with"ON" and existing indexes */
20132013
elseif (TailMatches2("INDEX","CONCURRENTLY"))
2014-
COMPLETE_WITH_CONST("ON");
2015-
/* If we have CREATE|UNIQUE INDEX <sth>, then add "ON" */
2016-
elseif (TailMatches3("CREATE|UNIQUE","INDEX",MatchAny))
2014+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
2015+
" UNION SELECT 'ON'");
2016+
/* Complete CREATE|UNIQUE INDEX [CONCURRENTLY] <sth> with "ON" */
2017+
elseif (TailMatches3("CREATE|UNIQUE","INDEX",MatchAny)||
2018+
TailMatches4("CREATE|UNIQUE","INDEX","CONCURRENTLY",MatchAny))
20172019
COMPLETE_WITH_CONST("ON");
20182020

20192021
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp