From bc56d5898d1cbd9dee6fe16ea7a814a5820b6181 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 10 Jan 2016 11:43:27 -0500 Subject: [PATCH] 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. --- src/bin/psql/tab-complete.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 -- 2.40.0