Re: Improve verification of recovery_target_timeline GUC.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: David Steele <david(at)pgbackrest(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve verification of recovery_target_timeline GUC.
Date: 2025-01-24 06:44:06
Message-ID: Z5M2tgQUMgCkyrKJ@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 23, 2025 at 02:53:39PM +0000, David Steele wrote:
> Currently check_recovery_target_timeline() converts any value that is not
> current, latest, or a valid integer to 0. So for example:
>
> recovery_target_timeline = 'currrent'
>
> results in the following error:
>
> FATAL: 22023: recovery target timeline 0 does not exist

Indeed, that's confusing. There is nothing telling you what's
actually wrong here, particularly if there is a typo of any kind in
the parameter.

> I discovered this while testing on Postgres versions < 12 where
> The tests are probably excessive but I needed something to show that the
> verification works as expected.

Even with your patch, specifying an incorrect name results in a
complaint about a timeline of 0. Wouldn't it be better to strengthen
the parsing in check_recovery_target_timeline() and/or the error
message reported?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-01-24 06:46:48 Re: pure parsers and reentrant scanners
Previous Message Gurjeet Singh 2025-01-24 06:33:29 Re: Disabling vacuum truncate for autovacuum