pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a "SQLSTATE-only" error verbosity option to libpq and psql.
Date: Thu, 04 Apr 2019 21:22:10 +0000
Message-ID: <E1hC9oI-0002ei-0P@gemulon.postgresql.org> (raw)

Add a "SQLSTATE-only" error verbosity option to libpq and psql.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7bac3acab4d5c3f2c35aa3a7bea08411d83fd5bc

Modified Files
--------------
doc/src/sgml/libpq.sgml             | 45 ++++++++++++++++++++++++-------------
doc/src/sgml/ref/psql-ref.sgml      |  8 ++++---
src/bin/psql/help.c                 |  4 ++--
src/bin/psql/startup.c              |  8 ++++---
src/bin/psql/tab-complete.c         |  2 +-
src/interfaces/libpq/fe-protocol3.c | 18 +++++++++++++++
src/interfaces/libpq/libpq-fe.h     |  3 ++-
src/test/regress/expected/psql.out  | 20 +++++++++++++++++
src/test/regress/sql/psql.sql       | 15 +++++++++++++
9 files changed, 98 insertions(+), 25 deletions(-)



Message-ID: <E1hC9oI-0002ei-0P@gemulon.postgresql.org>
Permalink:  ../E1hC9oI-0002ei-0P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hC9oI-0002ei-0P@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add a "SQLSTATE-only" error verbosity option to libpq and psql.
  In-Reply-To: <E1hC9oI-0002ei-0P@gemulon.postgresql.org>
  References: <E1hC9oI-0002ei-0P@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox