diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index ea75cdd3fc..397d637552 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -1103,6 +1103,8 @@ UpdateWorkerStats(XLogRecPtr last_lsn, TimestampTz send_time, bool reply) static void LogicalRepApplyLoop(XLogRecPtr last_received) { + TimestampTz last_recv_timestamp = GetCurrentTimestamp(); + /* * Init the ApplyMessageContext which we clean up after each replication * protocol message. @@ -1121,7 +1123,6 @@ LogicalRepApplyLoop(XLogRecPtr last_received) int len; char *buf = NULL; bool endofstream = false; - TimestampTz last_recv_timestamp = GetCurrentTimestamp(); bool ping_sent = false; long wait_time;