diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c new file mode 100644 index eb1b89b..c9444ca *** a/src/backend/replication/walsender.c --- b/src/backend/replication/walsender.c *************** static void *** 1048,1056 **** WalSndWriteData(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid, bool last_write) { - /* output previously gathered data in a CopyData packet */ - pq_putmessage_noblock('d', ctx->out->data, ctx->out->len); - /* * Fill the send timestamp last, so that it is taken as late as possible. * This is somewhat ugly, but the protocol's set as it's already used for --- 1048,1053 ---- *************** WalSndWriteData(LogicalDecodingContext * *** 1061,1066 **** --- 1058,1066 ---- memcpy(&ctx->out->data[1 + sizeof(int64) + sizeof(int64)], tmpbuf.data, sizeof(int64)); + /* output previously gathered data in a CopyData packet */ + pq_putmessage_noblock('d', ctx->out->data, ctx->out->len); + /* fast path */ /* Try to flush pending output to the client */ if (pq_flush_if_writable() != 0)