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.58 2004/09/10 20:05:18 tgl Exp $
8+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.59 2004/10/01 17:25:55 tgl Exp $
99 *
1010 *-------------------------------------------------------------------------
1111 */
@@ -174,12 +174,11 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
174174
175175if (noPwd || badPwd )
176176{
177-
178177if (badPwd )
179178fprintf (stderr ,"Password incorrect\n" );
180179
181180fprintf (stderr ,"Connecting to %s as %s\n" ,
182- PQdb ( AH -> connection ) ,newuser );
181+ newdb ,newuser );
183182
184183need_pass = true;
185184if (password )
@@ -189,6 +188,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
189188else
190189die_horribly (AH ,modulename ,"could not reconnect to database: %s" ,
191190PQerrorMessage (newConn ));
191+ PQfinish (newConn );
192192}
193193}while (need_pass );
194194
@@ -266,7 +266,7 @@ ConnectDatabase(Archive *AHX,
266266/* check to see that the backend connection was successfully made */
267267if (PQstatus (AH -> connection )== CONNECTION_BAD )
268268die_horribly (AH ,modulename ,"connection to database \"%s\" failed: %s" ,
269- PQdb ( AH -> connection ) ,PQerrorMessage (AH -> connection ));
269+ dbname ,PQerrorMessage (AH -> connection ));
270270
271271/* check for version mismatch */
272272_check_database_version (AH ,ignoreVersion );