Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a43bbe3

Browse files
author
Neil Conway
committed
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.
1 parent 58d214e commit a43bbe3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_dump/pg_backup_db.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Implements the basic DB functions used by the archiver.
66
*
77
* IDENTIFICATION
8-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.63 2005/07/01 21:03:25 momjian Exp $
8+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.64 2005/07/27 05:14:12 neilc Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -266,7 +266,7 @@ ConnectDatabase(Archive *AHX,
266266
/* check to see that the backend connection was successfully made */
267267
if (PQstatus(AH->connection) == CONNECTION_BAD)
268268
die_horribly(AH, modulename, "connection to database \"%s\" failed: %s",
269-
dbname, PQerrorMessage(AH->connection));
269+
PQdb(AH->connection), PQerrorMessage(AH->connection));
270270

271271
/* check for version mismatch */
272272
_check_database_version(AH, ignoreVersion);

0 commit comments

Comments
 (0)