diff options
author | Michael Paquier <michael@paquier.xyz> | 2025-07-03 11:14:20 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2025-07-03 11:14:20 +0900 |
commit | fd7d7b719137b5c427681a50c0a0ac2d745b68bd (patch) | |
tree | 999583ebba5990b105c36f895fbe88e645a315a2 /src/backend/access/gist/gistvalidate.c | |
parent | 0da29e4cb161f78a5ef534b3fb4467756a422e25 (diff) | |
download | postgresql-fd7d7b719137b5c427681a50c0a0ac2d745b68bd.tar.gz postgresql-fd7d7b719137b5c427681a50c0a0ac2d745b68bd.zip |
Improve checks for GUC recovery_target_timeline
Currently check_recovery_target_timeline() converts any value that is
not "current", "latest", or a valid integer to 0. So, for example, the
following configuration added to postgresql.conf followed by a startup:
recovery_target_timeline = 'bogus'
recovery_target_timeline = '9999999999'
... results in the following error patterns:
FATAL: 22023: recovery target timeline 0 does not exist
FATAL: 22023: recovery target timeline 1410065407 does not exist
This is confusing, because the server does not reflect the intention of
the user, and just reports incorrect data unrelated to the GUC.
The origin of the problem is that we do not perform a range check in the
GUC value passed-in for recovery_target_timeline. This commit improves
the situation by using strtou64() and by providing stricter range
checks. Some test cases are added for the cases of an incorrect, an
upper-bound and a lower-bound timeline value, checking the sanity of the
reports based on the contents of the server logs.
Author: David Steele <david@pgmasters.net>
Discussion: https://postgr.es/m/e5d472c7-e9be-4710-8dc4-ebe721b62cea@pgbackrest.org
Diffstat (limited to 'src/backend/access/gist/gistvalidate.c')
0 files changed, 0 insertions, 0 deletions