diff --git a/src/Core/PostgreSQL/Connection.cpp b/src/Core/PostgreSQL/Connection.cpp index e526396e1d1..dfdf14d3506 100644 --- a/src/Core/PostgreSQL/Connection.cpp +++ b/src/Core/PostgreSQL/Connection.cpp @@ -30,7 +30,7 @@ void Connection::execWithRetry(const std::function LOG_DEBUG(log, "Cannot execute query due to connection failure, attempt: {}/{}. (Message: {})", try_no, num_tries, e.what()); - if (try_no == num_tries) + if (try_no + 1 == num_tries) throw; } }