public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Steele <[email protected]>
To: Fujii Masao <[email protected]>
To: Hüseyin Demir <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Improve checks for GUC recovery_target_xid
Date: Wed, 4 Mar 2026 05:11:48 +0000 (UTC)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHGQGwEnakTrosMp3Y=Trya4MTC-h8Lqx3FDU1mOALRQ0rz59Q@mail.gmail.com>
References: <[email protected]>
<CAHGQGwEnakTrosMp3Y=Trya4MTC-h8Lqx3FDU1mOALRQ0rz59Q@mail.gmail.com>
On 2/27/26 08:12, Fujii Masao wrote:
> On Fri, Feb 20, 2026 at 2:42 PM David Steele <[email protected]> wrote:
>
> + GUC_check_errdetail("\"%s\" without epoch must greater than or equal to %u.",
>
> "must greater" shiould be "must be greater"?
Fixed in v2 attached to the prior email.
> "without epoch" seems not necessary to me.
I guess that depends on whether or not we error if the epoch is present,
see below.
> + /*
> + * This cast will remove the epoch, if any
> + */
> + xid = (TransactionId) strtou64(*newval, &endp, 0);
>
> Would it be better to use strtouint32_strict() instead of strtou64()?
> That would allow us to detect invalid XID values larger than 2^32 and
> report an error, similar to what pg_resetwal -x does.
This was my first instinct, but it causes our integration tests to fail
because pg_current_xact_id() returns the xid with epoch. You can fix
this by casting pg_current_xact_id()::xid but this seems like a pretty
big change in usage. I'm OK with it but we'd definitely need to update
the documentation to match.
What do you think?
Regards
-David
view thread (20+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Improve checks for GUC recovery_target_xid
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox