From 6932c8171f518271d1359ba72b0fef6e3fc89463 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Wed, 13 Apr 2022 11:13:12 +0200 Subject: [PATCH 3/5] Add additional information to be more helpful --- src/bin/initdb/initdb.c | 2 +- src/bin/pg_dump/pg_backup_db.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index ab826da650..81ad324040 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -2280,7 +2280,7 @@ setup_pgdata(void) * have embedded spaces. */ if (setenv("PGDATA", pg_data, 1) != 0) - pg_fatal("could not set environment"); + pg_fatal("could not set PGDATA environment variable"); } diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index 9a08ce8968..f71af03d62 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -167,7 +167,7 @@ ConnectDatabase(Archive *AHX, AH->connection = PQconnectdbParams(keywords, values, true); if (!AH->connection) - pg_fatal("could not connect to database"); + pg_fatal("could not connect to database \"%s\"", cparams->dbname); if (PQstatus(AH->connection) == CONNECTION_BAD && PQconnectionNeedsPassword(AH->connection) && -- 2.32.0 (Apple Git-132)