From 5e01ed1fccce083b1e1c13692d19474378c66db6 Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horikyoga.ntt@gmail.com>
Date: Wed, 15 Jul 2020 11:27:57 +0900
Subject: [PATCH] Explain pqPacketSend more precisely.

The comment explains that the function always returns STATUS_ERRUR for
write failure, but this may not be the case. Add description to make
it clear that there is such a case.
---
 src/interfaces/libpq/fe-connect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 7bee9dd201..af2818add4 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -4505,7 +4505,9 @@ PQrequestCancel(PGconn *conn)
  * buf, buf_len: contents of message.  The given length includes only what
  * is in buf; the message type and message length fields are added here.
  *
- * RETURNS: STATUS_ERROR if the write fails, STATUS_OK otherwise.
+ * RETURNS: STATUS_ERROR if the write fails, STATUS_OK otherwise. Note that the
+ * function may return STATUS_OK even if it failed to write to the underlying
+ * socket. (See pqSendSome comments about how failure should be handled.)
  * SIDE_EFFECTS: may block.
  *
  * Note: all messages sent with this routine have a length word, whether
-- 
2.18.4

