Re: Improve checks for GUC recovery_target_xid

From: David Steele <david(at)pgbackrest(dot)org>
To: Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: Improve checks for GUC recovery_target_xid
Date: 2026-03-04 05:07:22
Message-ID: 850c1b50-cc68-4b8b-8977-64da432f6644@pgbackrest.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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'. This passes the endp validation and FirstNormalTransactionId checks. Is it a valid approach to allow negative values to this GUC ?
>
> 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 Content-Type Size
recovery-target-xid-v2.patch text/plain 4.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2026-03-04 05:11:48 Re: Improve checks for GUC recovery_target_xid
Previous Message Tom Lane 2026-03-04 05:05:14 Re: change default default_toast_compression to lz4?