From 7bac3acab4d5c3f2c35aa3a7bea08411d83fd5bc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 4 Apr 2019 17:22:02 -0400 Subject: Add a "SQLSTATE-only" error verbosity option to libpq and psql. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is intended for use mostly in test scripts for external tools, which could do without cross-PG-version variations in error message wording. Of course, the SQLSTATE isn't guaranteed stable either, but it should be more so than the error message text. Note: there's a bit of an ABI change for libpq here, but it seems OK because if somebody compiles against a newer version of libpq-fe.h, and then tries to pass PQERRORS_SQLSTATE to PQsetErrorVerbosity() of an older libpq library, it will be accepted and then act like PQERRORS_DEFAULT, thanks to the way the tests in pqBuildErrorMessage3 have historically been phrased. That seems acceptable. Didier Gautheron, reviewed by Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/CAJRYxuKyj4zA+JGVrtx8OWAuBfE-_wN4sUMK4H49EuPed=mOBw@mail.gmail.com --- src/bin/psql/tab-complete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/psql/tab-complete.c') diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 22576adc51e..7c4e5fbacbe 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3652,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); -- cgit v1.2.3