Thank you for your comment!

I've added the must_use_password argument. A new patch is attached.


On 2024-06-26 23:36, Jelte Fennema-Nio wrote:
On Wed, 26 Jun 2024 at 14:53, ikedarintarof
<ikedarinta...@oss.nttdata.com> wrote:
The function 'libpqrcv_check_conninfo()' returns 'void', but the comment
above says that the function returns true or false.
I've attached a patch to modify the comment.

Agreed that the current comment is wrong, but the new comment should
mention the must_use_password argument. Because only if
must_use_password is true, will it throw an error.
From 18c302625176a38ecf95ede0bd0e5a4104358823 Mon Sep 17 00:00:00 2001
From: Rintaro Ikeda <51394766+rinik...@users.noreply.github.com>
Date: Thu, 27 Jun 2024 16:04:08 +0900
Subject: [PATCH] modify the commnet in libpqrcv_check_conninfo()

---
 src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 02f12f2921..252e97a19b 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -309,8 +309,9 @@ bad_connection:
  * local filesystem access to be attempted.
  *
  * If the connection string can't be parsed, this function will raise
- * an error and will not return. If it can, it will return true if this
- * connection string specifies a password and false otherwise.
+ * an error. If it can and must_use_password is false, it will do nothing.
+ * If must_use_password is true, the function checks whther a password is 
+ * provided and decides an error should be raised.
  */
 static void
 libpqrcv_check_conninfo(const char *conninfo, bool must_use_password)
-- 
2.39.3 (Apple Git-146)

Reply via email to