Fix tab completion of ANALYZE VERBOSE <tab>. It was previously confused
authorHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 27 Mar 2009 14:58:46 +0000 (14:58 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 27 Mar 2009 14:58:46 +0000 (14:58 +0000)
with EXPLAIN ANALYZE VERBOSE.

Greg Sabino Mullane, reformatted by myself. Backpatch to 8.1, where the
bug was introduced.

src/bin/psql/tab-complete.c

index 6241cfec0408ce3c10f45fee673c8bfe541fd5a0..8f6a808a8cdd6116ef960fa12d2f6d71b94d401c 100644 (file)
@@ -1624,11 +1624,11 @@ psql_completion(char *text, int start, int end)
 
                COMPLETE_WITH_LIST(list_EXPLAIN);
        }
-       else if (pg_strcasecmp(prev_wd, "VERBOSE") == 0 &&
-                        pg_strcasecmp(prev3_wd, "VACUUM") != 0 &&
-                        pg_strcasecmp(prev4_wd, "VACUUM") != 0 &&
-                        (pg_strcasecmp(prev2_wd, "ANALYZE") == 0 ||
-                         pg_strcasecmp(prev2_wd, "EXPLAIN") == 0))
+       else if ((pg_strcasecmp(prev2_wd, "EXPLAIN") == 0 &&
+                         pg_strcasecmp(prev_wd, "VERBOSE") == 0) ||
+                        (pg_strcasecmp(prev3_wd, "EXPLAIN") == 0 &&
+                         pg_strcasecmp(prev2_wd, "ANALYZE") == 0 &&
+                         pg_strcasecmp(prev_wd, "VERBOSE") == 0))
        {
                static const char *const list_EXPLAIN[] =
                {"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", NULL};