Re: Consistently use the XLogRecPtrIsInvalid() macro - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Consistently use the XLogRecPtrIsInvalid() macro
Date
Msg-id aQDAsFbIaj-b7Ag9@paquier.xyz
Whole thread Raw
In response to Re: Consistently use the XLogRecPtrIsInvalid() macro  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Consistently use the XLogRecPtrIsInvalid() macro
List pgsql-hackers
On Tue, Oct 28, 2025 at 01:40:24PM +0200, Heikki Linnakangas wrote:
> It's also a bit cumbersome that we have XLogRecPtrIsInvalid() rather than
> XLogRecPtrIsValid(). That's inconsistent with OidIsValid and
> TransactionIdInValid, and it leads to an awkward double negative 'if
> (!XLogRecPtrIsInvalid(x))' if you want to check that 'x' is valid.
>
> Overall I'm inclined to do nothing. But if anything, perhaps introduce
> XLogRecPtrIsValid(x) and switch to that, or replace XLogRecPtrIsInvalid(x)
> calls with 'x == InvalidXLogRecPtr'

The annoying part with eliminating XLogRecPtrIsInvalid() or replacing
it is that a bunch of external code would be broken, particularly
backup tools.  I'd rather leave the beast alone.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Daniil Davydov
Date:
Subject: Re: POC: Parallel processing of indexes in autovacuum
Next
From: Amit Langote
Date:
Subject: Re: Batching in executor