When completing ALTER INDEX .. SET, add an equals sign also.
authorRobert Haas <[email protected]>
Sat, 7 Nov 2015 03:59:47 +0000 (22:59 -0500)
committerRobert Haas <[email protected]>
Sat, 7 Nov 2015 03:59:47 +0000 (22:59 -0500)
Jeff Janes

src/bin/psql/tab-complete.c

index 0e8d3951a29ff24c1098f9d4acd09e72270d697b..b58ec14418f233c2b53196b455b2b78633ad7771 100644 (file)
@@ -1216,8 +1216,7 @@ psql_completion(const char *text, int start, int end)
    /* ALTER INDEX <foo> SET|RESET ( */
    else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
             pg_strcasecmp(prev4_wd, "INDEX") == 0 &&
-            (pg_strcasecmp(prev2_wd, "SET") == 0 ||
-             pg_strcasecmp(prev2_wd, "RESET") == 0) &&
+            pg_strcasecmp(prev2_wd, "RESET") == 0 &&
             pg_strcasecmp(prev_wd, "(") == 0)
    {
        static const char *const list_INDEXOPTIONS[] =
@@ -1225,6 +1224,16 @@ psql_completion(const char *text, int start, int end)
 
        COMPLETE_WITH_LIST(list_INDEXOPTIONS);
    }
+   else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
+            pg_strcasecmp(prev4_wd, "INDEX") == 0 &&
+            pg_strcasecmp(prev2_wd, "SET") == 0 &&
+            pg_strcasecmp(prev_wd, "(") == 0)
+   {
+       static const char *const list_INDEXOPTIONS[] =
+       {"fillfactor =", "fastupdate =", "gin_pending_list_limit =", NULL};
+
+       COMPLETE_WITH_LIST(list_INDEXOPTIONS);
+   }
 
    /* ALTER LANGUAGE <name> */
    else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&