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

Commit4189e3d

Browse files
committed
psql: Add completion support for DROP INDEX CONCURRENTLY
based on patch by Kyotaro Horiguchi
1 parentcf7dfbf commit4189e3d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,8 +2009,8 @@ psql_completion(const char *text, int start, int end)
20092009
elseif (TailMatches3("INDEX|CONCURRENTLY",MatchAny,"ON")||
20102010
TailMatches2("INDEX|CONCURRENTLY","ON"))
20112011
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tm,NULL);
2012-
/* Complete... INDEX CONCURRENTLY with "ON" and existing indexes */
2013-
elseif (TailMatches2("INDEX","CONCURRENTLY"))
2012+
/* CompleteCREATE|UNIQUE INDEX CONCURRENTLY with "ON" and existing indexes */
2013+
elseif (TailMatches3("CREATE|UNIQUE","INDEX","CONCURRENTLY"))
20142014
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
20152015
" UNION SELECT 'ON'");
20162016
/* Complete CREATE|UNIQUE INDEX [CONCURRENTLY] <sth> with "ON" */
@@ -2247,7 +2247,7 @@ psql_completion(const char *text, int start, int end)
22472247
/* DROP */
22482248
/* Complete DROP object with CASCADE / RESTRICT */
22492249
elseif (Matches3("DROP",
2250-
"COLLATION|CONVERSION|DOMAIN|EXTENSION|INDEX|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW",
2250+
"COLLATION|CONVERSION|DOMAIN|EXTENSION|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW",
22512251
MatchAny)||
22522252
(Matches4("DROP","AGGREGATE|FUNCTION",MatchAny,MatchAny)&&
22532253
ends_with(prev_wd,')'))||
@@ -2265,6 +2265,17 @@ psql_completion(const char *text, int start, int end)
22652265
elseif (Matches2("DROP","FOREIGN"))
22662266
COMPLETE_WITH_LIST2("DATA WRAPPER","TABLE");
22672267

2268+
/* DROP INDEX */
2269+
elseif (Matches2("DROP","INDEX"))
2270+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
2271+
" UNION SELECT 'CONCURRENTLY'");
2272+
elseif (Matches3("DROP","INDEX","CONCURRENTLY"))
2273+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,NULL);
2274+
elseif (Matches3("DROP","INDEX",MatchAny))
2275+
COMPLETE_WITH_LIST2("CASCADE","RESTRICT");
2276+
elseif (Matches4("DROP","INDEX","CONCURRENTLY",MatchAny))
2277+
COMPLETE_WITH_LIST2("CASCADE","RESTRICT");
2278+
22682279
/* DROP MATERIALIZED VIEW */
22692280
elseif (Matches2("DROP","MATERIALIZED"))
22702281
COMPLETE_WITH_CONST("VIEW");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp