From 59292f28cace8c0d4b038cadbb127b440e3a7815 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Fri, 26 Mar 2010 12:23:34 +0000
Subject: [PATCH] Flush CopyOutResponse when starting streaming in walsender,
 so that it's not delayed until the first WAL record is sent.

Fujii Masao
---
 src/backend/replication/walsender.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index f1a995dccc4..21058d10ba7 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -30,7 +30,7 @@
  *
  *
  * IDENTIFICATION
- *	  $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.12 2010/03/24 21:41:57 sriggs Exp $
+ *	  $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.13 2010/03/26 12:23:34 heikki Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -263,6 +263,7 @@ WalSndHandshake(void)
 						pq_sendbyte(&buf, 0);
 						pq_sendint(&buf, 0, 2);
 						pq_endmessage(&buf);
+						pq_flush();
 
 						/*
 						 * Initialize position to the received one, then the
-- 
GitLab