--- ../original/asterisk-1.6.2.6/res/res_config_pgsql.c 2009-11-10 10:58:22.000000000 -0430 +++ res/res_config_pgsql.c 2010-03-22 21:14:48.000000000 -0430 @@ -471,7 +471,7 @@ return NULL; } - ast_str_set(&sql, 0, "SELECT * FROM %s WHERE %s%s '%s'", table, newparam, op, ast_str_buffer(escapebuf)); + ast_str_set(&sql, 0, "SELECT * FROM %s WHERE %s%s E'%s'", table, newparam, op, ast_str_buffer(escapebuf)); while ((newparam = va_arg(ap, const char *))) { newval = va_arg(ap, const char *); if (!strchr(newparam, ' ')) @@ -563,8 +563,7 @@ } ast_free(fieldnames); } else { - ast_log(LOG_WARNING, - "PostgreSQL RealTime: Could not find any rows in table %s.\n", table); + ast_debug(1, "Postgresql RealTime: Could not find any rows in table %s@%s.\n", table, database); } ast_mutex_unlock(&pgsql_lock);