Re: Improve checks for GUC recovery_target_xid - Mailing list pgsql-hackers

From David Steele
Subject Re: Improve checks for GUC recovery_target_xid
Date
Msg-id 850c1b50-cc68-4b8b-8977-64da432f6644@pgbackrest.org
Whole thread Raw
In response to Re: Improve checks for GUC recovery_target_xid  (Hüseyin Demir <huseyin.d3r@gmail.com>)
List pgsql-hackers
Thanks for having a look at this!

On 2/26/26 14:20, Hüseyin Demir wrote:
> 
> The following grammar can be changed by adding "without epoch must be greater than or equal to %u"
> +           GUC_check_errdetail("\"%s\" without epoch must greater than or equal to %u.",
> +                               "recovery_target_xid",
> +                               FirstNormalTransactionId);

Oops - fixed!

> The comment on the lower-bound XID test says # Timeline target out of min range — should be # XID target out of min
range.

I have fixed this and made the comments more consistent overall.

> When it comes to *endp validations I suppose the validation passes when we provide   recovery_target_xid = '-1'.
Thispasses the endp validation and FirstNormalTransactionId checks. Is it a valid approach to allow negative values to
thisGUC ?
 
> 
> When -1 is provided the following checks allow them to be a valid GUC.

Yeah, -1 should not be allowed here. I've updated the code to error on 
negative numbers but probably we should import strtou64_strict from the 
front end code or use strtou32_strict, though that needs to be discussed 
separately.

Thanks,
-David
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: change default default_toast_compression to lz4?
Next
From: David Steele
Date:
Subject: Re: Improve checks for GUC recovery_target_xid