-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.17.2.1 2003/11/24 13:11:27 petere Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.17.2.2 2006/06/19 09:20:32 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
const char *errmsg = PQerrorMessage(this->connection);
char *db = realname ? realname : "<DEFAULT>";
- ecpg_finish(this);
-#ifdef ENABLE_THREAD_SAFETY
- pthread_mutex_unlock(&connections_mutex);
-#endif
ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n",
db,
host ? host : "<DEFAULT>",
user ? "for user " : "", user ? user : "",
lineno, errmsg);
+ ecpg_finish(this);
+#ifdef ENABLE_THREAD_SAFETY
+ pthread_mutex_unlock(&connections_mutex);
+#endif
+
ECPGraise(lineno, ECPG_CONNECT, ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION, db);
if (host)
ECPGfree(host);