pgsql: Fix tracing of BackendKeyData and CancelRequest

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix tracing of BackendKeyData and CancelRequest
Date: 2026-07-03 12:05:58
Message-ID: E1wfcec-001AAc-2P@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix tracing of BackendKeyData and CancelRequest

BackendKeyData length was increased from 4 bytes to a variable-length
length (up to 256 bytes) in a460251f0a. However, pqTrace still traces
it as a 4 bytes key, leading to a "mismatched message length" warning
message. The same issue impacts the tracing of CancelRequest.

This patch fixes the issue by using pqTraceOutputNchar instead of
pqTraceOutputInt32 in both cases.

Author: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Discussion: https://www.postgresql.org/message-id/CAO6_Xqo6gTv9=76H=k2qDRFU+KHuBiY2S=bQynEr6J8gS7L6xA@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dd5eca055d484af41eb6d50d6eeea7cb065d450c

Modified Files
--------------
src/interfaces/libpq/fe-trace.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-07-03 14:39:39 pgsql: Fix handling of dropping a property not associated with the give
Previous Message Álvaro Herrera 2026-07-03 10:23:44 pgsql: Fix REPACK CONCURRENTLY for stored generated columns