pgsql: Fix socket_putmessage_noblock() to call socket_putmessage()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix socket_putmessage_noblock() to call socket_putmessage()
Date: 2026-07-23 07:53:55
Message-ID: E1wmoFf-00000000PRJ-2nXy@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix socket_putmessage_noblock() to call socket_putmessage()

socket_putmessage_noblock() used pq_putmessage(), which redirects to
PqCommMethods->putmessage. In the common cases, this points to
socket_putmessage(), but it would become incorrect if PqCommMethods
points to a different implementation.

This change may look like a bug, but as far as I can see this is mostly
cosmetic. The code is able to work currently, as the repalloc() done in
the noblock() call ensures that the blocking path of internal_putbytes()
is never reached. The issue has gone unnoticed since 2bd9e412f92b.

Author: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAO6_Xqpf5+Rzw_-XOOz-d-R5x6_2JHtpnzXP0nrYWiHyZokA_Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/544d25b7af958ca6c03e98bfbc1538c295b30601

Modified Files
--------------
src/backend/libpq/pqcomm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-07-23 10:27:14 pgsql: doc: Improve pg_stat_recovery documentation
Previous Message Michael Paquier 2026-07-23 07:22:20 pgsql: doc: Improve description of pg_stat_activity.backend_type