pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report the true database name on connection errors
Date: Tue, 26 Jan 2021 19:43:13 +0000
Message-ID: <E1l4UF7-0006w1-5a@gemulon.postgresql.org> (raw)

Report the true database name on connection errors

When reporting connection errors, we might show a database name in the
message that's not the one we actually tried to connect to, if the
database was taken from libpq defaults instead of from user parameters.
Fix such error messages to use PQdb(), which reports the correct name.

(But, per commit 2930c05634bc, make sure not to try to print NULL.)

Apply to branches 9.5 through 13.  Branch master has already been
changed differently by commit 58cd8dca3de0.

Reported-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://postgr.es/m/CA+TgmobssJ6rS22dspWnu-oDxXevGmhMD8VcRBjmj-b9UDqRjw@mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/11a708f8159fa9752ecc78a157b62d54cd0b7a2f

Modified Files
--------------
contrib/oid2name/oid2name.c  | 2 +-
contrib/vacuumlo/vacuumlo.c  | 2 +-
src/bin/pg_dump/pg_dumpall.c | 2 +-
src/bin/pgbench/pgbench.c    | 5 +++--
4 files changed, 6 insertions(+), 5 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1l4UF7-0006w1-5a@gemulon.postgresql.org>
Permalink:  ../E1l4UF7-0006w1-5a@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l4UF7-0006w1-5a@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Report the true database name on connection errors
  In-Reply-To: <E1l4UF7-0006w1-5a@gemulon.postgresql.org>
  References: <E1l4UF7-0006w1-5a@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