]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix version check for retain_dead_tuples subscription option.
authorFujii Masao <fujii@postgresql.org>
Wed, 24 Dec 2025 14:25:00 +0000 (23:25 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 24 Dec 2025 14:25:00 +0000 (23:25 +0900)
The retain_dead_tuples subscription option is supported only when
the publisher runs PostgreSQL 19 or later. However, it could previously
be enabled even when the publisher was running an earlier version.

This was caused by check_pub_dead_tuple_retention() comparing
the publisher server version against 19000 instead of 190000.

Fix this typo so that the version check correctly enforces the PG19+
requirement.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwEx4twHtJdiPWTyAXJhcBPLaH467SH2ajGSe-41m65giA@mail.gmail.com

src/backend/commands/subscriptioncmds.c

index 921cd9674f1019becb6a48a55f78e2660766030d..7b118a502006d27a8b32101d26c2ad57a9b2db9e 100644 (file)
@@ -2753,7 +2753,7 @@ check_pub_dead_tuple_retention(WalReceiverConn *wrconn)
        bool            isnull;
        bool            remote_in_recovery;
 
-       if (walrcv_server_version(wrconn) < 19000)
+       if (walrcv_server_version(wrconn) < 190000)
                ereport(ERROR,
                                errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
                                errmsg("cannot enable retain_dead_tuples if the publisher is running a version earlier than PostgreSQL 19"));