--- res_config_pgsql.c 2010-09-01 20:16:37.000000000 +0200 +++ res_config_pgsql.c.new 2010-11-19 00:24:40.000000000 +0100 @@ -18,6 +18,7 @@ * * \author Mark Spencer * \author Manuel Guesdon - PostgreSQL RealTime Driver Author/Adaptor + * \bugfix German Aracil - pgsql_reconnect(dbname) * * \extref PostgreSQL http://www.postgresql.org */ @@ -353,7 +354,7 @@ /* We now have our complete statement; Lets connect to the server and execute it. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconnect(dbname)) { ast_mutex_unlock(&pgsql_lock); return NULL; } @@ -508,7 +509,7 @@ /* We now have our complete statement; Lets connect to the server and execute it. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return NULL; } @@ -677,7 +678,7 @@ /* We now have our complete statement; Lets connect to the server and execute it. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return -1; } @@ -808,7 +809,7 @@ /* We now have our complete statement; connect to the server and execute it. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return -1; } @@ -883,7 +884,7 @@ /* Must connect to the server before anything else, as the escape function requires the connection handle.. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return -1; } @@ -975,7 +976,7 @@ /* Must connect to the server before anything else, as the escape function requires the connection handle.. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return -1; } @@ -1064,7 +1065,7 @@ /* We now have our complete statement; Lets connect to the server and execute it. */ ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); return NULL; } @@ -1236,7 +1237,7 @@ ast_debug(1, "About to lock pgsql_lock (running alter on table '%s' to add column '%s')\n", tablename, elm); ast_mutex_lock(&pgsql_lock); - if (!pgsql_reconnect(database)) { + if (!pgsql_reconect(dbname)) { ast_mutex_unlock(&pgsql_lock); ast_log(LOG_ERROR, "Unable to add column: %s\n", ast_str_buffer(sql)); ast_free(sql);