summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway2005-07-27 05:14:12 +0000
committerNeil Conway2005-07-27 05:14:12 +0000
commita43bbe34ff0d3a8a270a1118e7a727732ce617d4 (patch)
tree04dc120b006692cc81f4f94ecedcfc3e00a64c93
parent58d214e51fe50b10b4439da6ec263d54c155afbf (diff)
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 047a1aa9182..66833ebdb1e 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.63 2005/07/01 21:03:25 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.64 2005/07/27 05:14:12 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -266,7 +266,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);