From: Peter Eisentraut Date: Sun, 10 Jan 2016 16:43:27 +0000 (-0500) Subject: psql: Fix CREATE INDEX tab completion X-Git-Tag: REL9_6_BETA1~863 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc56d5898d1cbd9dee6fe16ea7a814a5820b6181;p=postgresql psql: Fix CREATE INDEX tab completion The previous code supported a syntax like CREATE INDEX name CONCURRENTLY, which never existed. Mistake introduced in commit 37ec19a15ce452ee94f32ebc3d6a9a45868e82fd. Remove the addition of CONCURRENTLY at that point. --- diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index dcbe515fcc..52336aa96d 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2009,13 +2009,12 @@ psql_completion(const char *text, int start, int end) else if (TailMatches3("INDEX", MatchAny, "ON") || TailMatches2("INDEX|CONCURRENTLY", "ON")) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tm, NULL); - /* If we have CREATE|UNIQUE INDEX CONCURRENTLY, then add "ON" */ - else if (TailMatches3("INDEX", MatchAny, "CONCURRENTLY") || - TailMatches2("INDEX", "CONCURRENTLY")) + /* If we have CREATE|UNIQUE INDEX CONCURRENTLY, then add "ON" */ + else if (TailMatches2("INDEX", "CONCURRENTLY")) COMPLETE_WITH_CONST("ON"); - /* If we have CREATE|UNIQUE INDEX , then add "ON" or "CONCURRENTLY" */ + /* If we have CREATE|UNIQUE INDEX , then add "ON" */ else if (TailMatches3("CREATE|UNIQUE", "INDEX", MatchAny)) - COMPLETE_WITH_LIST2("CONCURRENTLY", "ON"); + COMPLETE_WITH_CONST("ON"); /* * Complete INDEX ON with a list of table columns (which