]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Improve validation of recovery_target_xid GUC values.
authorFujii Masao <fujii@postgresql.org>
Thu, 5 Mar 2026 12:40:32 +0000 (21:40 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 5 Mar 2026 12:40:32 +0000 (21:40 +0900)
commitbffd7130e942e2bd45153ab09e5fab70e74ece58
treeff3ae9aa6a63a72956982f608cd5cbf849ba4465
parent9b0e5bd5320f95cfb35f0402c0f4bb7a1d3ecb0f
Improve validation of recovery_target_xid GUC values.

Previously, the recovery_target_xid GUC values were not sufficiently validated.
As a result, clearly invalid inputs such as the string "bogus", a decimal value
like "1.1", or 0 (a transaction ID smaller than the minimum valid value of 3)
were unexpectedly accepted. In these cases, the value was interpreted as
transaction ID 0, which could cause recovery to behave unexpectedly.

This commit improves validation of recovery_target_xid GUC so that invalid
values are rejected with an error. This prevents recovery from proceeding
with misconfigured recovery_target_xid settings.

Also this commit updates the documentation to clarify the allowed values
for recovery_target_xid GUC.

Author: David Steele <david@pgbackrest.org>
Reviewed-by: Hüseyin Demir <huseyin.d3r@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/f14463ab-990b-4ae9-a177-998d2677aae0@pgbackrest.org
doc/src/sgml/config.sgml
src/backend/access/transam/xlogrecovery.c
src/test/recovery/t/003_recovery_targets.pl