--- res/res_config_pgsql.c.orig2 +++ res/res_config_pgsql.c @@ -1229,6 +1229,7 @@ if (!column) { if (requirements == RQ_WARN) { ast_log(LOG_WARNING, "Table %s requires a column '%s' of size '%d', but no such column exists.\n", tablename, elm, size); + res = -1; } else { struct ast_str *sql = ast_str_create(100); char fieldtype[15]; @@ -1268,8 +1269,8 @@ ast_debug(1, "About to run ALTER query on table '%s' to add column '%s'\n", tablename, elm); if (pgsql_exec(database, tablename, ast_str_buffer(sql), &result) != 0) { - ast_mutex_unlock(&pgsql_lock); - return -1; + ast_mutex_unlock(&pgsql_lock); + return -1; } ast_debug(1, "Finished running ALTER query on table '%s'\n", tablename);