Thread: pgsql: Avoid redundantly prefixing PQerrorMessage for a connection fail

pgsql: Avoid redundantly prefixing PQerrorMessage for a connection fail

From
Tom Lane
Date:
Avoid redundantly prefixing PQerrorMessage for a connection failure.

libpq's error messages for connection failures pretty well stand on
their own, especially since commits 52a10224e/27a48e5a1.  Prefixing
them with 'could not connect to database "foo"' or the like is just
redundant, and perhaps even misleading if the specific database name
isn't relevant to the failure.  (When it is, we trust that the
backend's error message will include the DB name.)  Indeed, psql
hasn't used any such prefix in a long time.  So, make all our other
programs and documentation examples agree with psql's practice.

Discussion: https://postgr.es/m/1094524.1611266589@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/58cd8dca3de0b3c7d378a412eca1f7289b5e4978

Modified Files
--------------
contrib/oid2name/oid2name.c                            |  3 +--
contrib/vacuumlo/vacuumlo.c                            |  3 +--
doc/src/sgml/libpq.sgml                                | 13 +++++--------
doc/src/sgml/lobj.sgml                                 |  3 +--
src/bin/pg_dump/pg_backup_db.c                         |  6 ++----
src/bin/pg_dump/pg_dumpall.c                           |  3 +--
src/bin/pg_dump/t/002_pg_dump.pl                       |  2 +-
src/bin/pg_upgrade/server.c                            |  8 ++++----
src/bin/pgbench/pgbench.c                              |  3 +--
src/bin/pgbench/t/001_pgbench_with_server.pl           |  2 +-
src/bin/scripts/common.c                               |  3 +--
src/interfaces/ecpg/ecpglib/connect.c                  |  3 ++-
src/interfaces/ecpg/test/expected/connect-test5.stderr |  6 ++----
src/test/examples/testlibpq.c                          |  3 +--
src/test/examples/testlibpq2.c                         |  3 +--
src/test/examples/testlibpq3.c                         |  3 +--
src/test/examples/testlibpq4.c                         |  3 +--
src/test/examples/testlo.c                             |  3 +--
src/test/examples/testlo64.c                           |  3 +--
src/test/isolation/isolationtester.c                   |  2 +-
src/tools/findoidjoins/findoidjoins.c                  |  2 +-
21 files changed, 31 insertions(+), 49 deletions(-)