]> granicus.if.org Git - postgresql/commitdiff
Fix tab completion for UPDATE.
authorThomas Munro <tmunro@postgresql.org>
Sat, 13 Jul 2019 03:56:20 +0000 (15:56 +1200)
committerThomas Munro <tmunro@postgresql.org>
Sat, 13 Jul 2019 04:08:13 +0000 (16:08 +1200)
Previously it suggested an extra "=" after "SET x=".

Reported-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/CA%2BhUKGLk%3D0yLDjfviONJLzcHEzygj%3Dx6VbGH43LnXbBUvQb52g%40mail.gmail.com

src/bin/psql/tab-complete.c

index 9b9202e84c0fa94e0861fea40f9daacd663b3f60..3f7001fb696af2a11ab7bcd3d7834a0f0cf21147 100644 (file)
@@ -3487,7 +3487,7 @@ psql_completion(const char *text, int start, int end)
        else if (TailMatches("UPDATE", MatchAny, "SET"))
                COMPLETE_WITH_ATTR(prev2_wd, "");
        /* UPDATE <table> SET <attr> = */
-       else if (TailMatches("UPDATE", MatchAny, "SET", MatchAny))
+       else if (TailMatches("UPDATE", MatchAny, "SET", MatchAnyExcept("*=")))
                COMPLETE_WITH("=");
 
 /* USER MAPPING */