aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2005-07-27 05:15:03 +0000
committerNeil Conway <neilc@samurai.com>2005-07-27 05:15:03 +0000
commitf4bbe13491cd3407d383a72b7b0dee2c707a4ef7 (patch)
tree71482deaeb5d39afee1c023c4f7ed556cb220986
parent4ee7e8213cfd44760a79fc6bd19540ffae960721 (diff)
downloadpostgresql-f4bbe13491cd3407d383a72b7b0dee2c707a4ef7.tar.gz
postgresql-f4bbe13491cd3407d383a72b7b0dee2c707a4ef7.zip
Avoid crashing pg_dump if we can't connect to the database server, and
no database has been explicitly specified. Per gripe from Omar Kilani.
-rw-r--r--src/bin/pg_dump/pg_backup_db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 3a79f478332..50c0f4606dc 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.61 2004/11/06 19:36:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.61.4.1 2005/07/27 05:15:03 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -267,7 +267,7 @@ ConnectDatabase(Archive *AHX,
/* check to see that the backend connection was successfully made */
if (PQstatus(AH->connection) == CONNECTION_BAD)
die_horribly(AH, modulename, "connection to database \"%s\" failed: %s",
- dbname, PQerrorMessage(AH->connection));
+ PQdb(AH->connection), PQerrorMessage(AH->connection));
/* check for version mismatch */
_check_database_version(AH, ignoreVersion);