pgsql: Tighten proto_version parsing in pgoutput

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Tighten proto_version parsing in pgoutput
Date: 2026-08-06 07:59:49
Message-ID: E1wrt13-00000000PHF-242g@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tighten proto_version parsing in pgoutput

This is similar to 58ff4a0a0867, but this time for the parameter
"proto_version", when given as a parameter to pgoutput for logical
replication. strtoul() lacked a check for an empty string, leading to
an inconsistent behavior depending on the platform.

The author has originally proposed a TAP test to check this empty value
pattern. I have added a cheaper SQL query, instead, test_decoding
including a test area where this is possible.

Author: Tristan Partin <tristan(at)partin(dot)io>
Discussion: https://postgr.es/m/DKBS2Z9CGARC.2T07O6TJYSE8B@partin.io

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/290bb8afe6b47adb8b080688bd97a710af351cb1

Modified Files
--------------
contrib/test_decoding/expected/replorigin.out | 4 ++++
contrib/test_decoding/sql/replorigin.sql | 3 +++
src/backend/replication/pgoutput/pgoutput.c | 5 +++--
3 files changed, 10 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-08-06 08:43:00 pgsql: Report duplicate property and label names with a proper error
Previous Message Michael Paquier 2026-08-06 06:41:09 pgsql: Tighten tid input parsing with strtoul() to reject empty fields