Commits on Aug 22, 2026
-
Print cancel key as a hex string in trace
Currently, cancel key is printed with pqTraceOutputNchar, which prints printable char as char, and the rest as hex. As the cancel key is just random bytes, there's not much meaning to print them as chars. This patch introduces a new pqTraceOutputNbyte to print bytes using only hex.
-
Add more regress masks in pqtrace
Tracing ParameterStatus or StartupMessage will write parameter values like username, which is very likely to change depending on the test environment. This patch adds additional regress masking, hiding the parameter values and the packet length of ParameterStatus and StartupMessage to allow tests to compare traces capturing such messages.
bonnefoa authored and Commitfest Bot committed
Aug 22, 2026 -
Add mismatch length check on pqTraceOutputNoTypeByteMessage
Currently, pqTraceOutputMessage checks that traced messages are correctly consumed. However, such a check doesn't exist for messages with no type. This commit adds a similar check in pqTraceOutputNoTypeByteMessage, checking that the consumed bytes matches the message length.
bonnefoa authored and Commitfest Bot committed
Aug 22, 2026 -
Make pqtrace write lines atomically
Currently, pqtrace writes are done by doing multiple fprintf per line to the Pfdebug fd. This commit changes fe-trace.c to buffer each line in a PQExpBuffer, and write lines in Pfdebug in a single fwrite. This allows multiple connections to write on stdout without interfering with each other.
bonnefoa authored and Commitfest Bot committed
Aug 22, 2026 -
Add PQTRACE env to enable protocol tracing in libpq
Add 2 env vars, PQTRACE and PQTRACEFLAGS. When PQTRACE is set, PQtrace will be called when connection options are processed. This allows to enable protocol tracing on application using libpq without requiring specific code. Setting PQTRACE to "-" will output protocol tracing on stdout. PQTRACEFLAGS is the bitwise value of the PQTRACE_SUPPRESS_TIMESTAMPS(1) and PQTRACE_REGRESS_MODE(2) flags.
bonnefoa authored and Commitfest Bot committed
Aug 22, 2026 -
Add trace of startup packets in libpq_pipeline tests
The current way to enable tracing in libpq_pipeline only set PQtrace after the connection is created, missing the trace of the startup packets. This patch replaces it by the trace_file connection parameter, enabling PQtrace before the first packet is sent and thus tracing all protocol messages.
bonnefoa authored and Commitfest Bot committed
Aug 22, 2026