]> granicus.if.org Git - postgresql/blobdiff - src/bin/psql/tab-complete.c
Add a "SQLSTATE-only" error verbosity option to libpq and psql.
[postgresql] / src / bin / psql / tab-complete.c
index ab69a2c946d2c70b731878622e5639477bb107e1..7c4e5fbacbe6cb4743f3e804a4eace898b2f059e 100644 (file)
@@ -1039,6 +1039,7 @@ static const char *const table_storage_parameters[] = {
        "toast.log_autovacuum_min_duration",
        "toast_tuple_target",
        "user_catalog_table",
+       "vacuum_index_cleanup",
        NULL
 };
 
@@ -3443,7 +3444,10 @@ psql_completion(const char *text, int start, int end)
                 */
                if (ends_with(prev_wd, '(') || ends_with(prev_wd, ','))
                        COMPLETE_WITH("FULL", "FREEZE", "ANALYZE", "VERBOSE",
-                                                 "DISABLE_PAGE_SKIPPING", "SKIP_LOCKED");
+                                                 "DISABLE_PAGE_SKIPPING", "SKIP_LOCKED",
+                                                 "INDEX_CLEANUP");
+               else if (TailMatches("FULL|FREEZE|ANALYZE|VERBOSE|DISABLE_PAGE_SKIPPING|SKIP_LOCKED|INDEX_CLEANUP"))
+                       COMPLETE_WITH("ON", "OFF");
        }
        else if (HeadMatches("VACUUM") && TailMatches("("))
                /* "VACUUM (" should be caught above, so assume we want columns */
@@ -3648,7 +3652,7 @@ psql_completion(const char *text, int start, int end)
                else if (TailMatchesCS("SHOW_CONTEXT"))
                        COMPLETE_WITH_CS("never", "errors", "always");
                else if (TailMatchesCS("VERBOSITY"))
-                       COMPLETE_WITH_CS("default", "verbose", "terse");
+                       COMPLETE_WITH_CS("default", "verbose", "terse", "sqlstate");
        }
        else if (TailMatchesCS("\\sf*"))
                COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines, NULL);
@@ -4327,7 +4331,7 @@ exec_query(const char *query)
        if (PQresultStatus(result) != PGRES_TUPLES_OK)
        {
 #ifdef NOT_USED
-               psql_error("tab completion query failed: %s\nQuery was:\n%s\n",
+               pg_log_error("tab completion query failed: %s\nQuery was:\n%s",
                                   PQerrorMessage(pset.db), query);
 #endif
                PQclear(result);