]> granicus.if.org Git - postgresql/commitdiff
psql: Fix CREATE INDEX tab completion
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 10 Jan 2016 16:43:27 +0000 (11:43 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 13 Jan 2016 01:54:27 +0000 (20:54 -0500)
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

index dcbe515fccb9e1628498f75557a969e9dd3d294b..52336aa96d108a36d3a66285161e51734c0dcd17 100644 (file)
@@ -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 <sth> 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 <sth>, then add "ON" or "CONCURRENTLY" */
+       /* If we have CREATE|UNIQUE INDEX <sth>, then add "ON" */
        else if (TailMatches3("CREATE|UNIQUE", "INDEX", MatchAny))
-               COMPLETE_WITH_LIST2("CONCURRENTLY", "ON");
+               COMPLETE_WITH_CONST("ON");
 
        /*
         * Complete INDEX <name> ON <table> with a list of table columns (which