From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid redundantly prefixing PQerrorMessage for a connection fail
Date: Fri, 22 Jan 2021 21:52:48 +0000
Message-ID: <E1l34MK-00060x-SF@gemulon.postgresql.org> (raw)
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(-)
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: Avoid redundantly prefixing PQerrorMessage for a connection fail
In-Reply-To: <E1l34MK-00060x-SF@gemulon.postgresql.org>
References: <E1l34MK-00060x-SF@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