pgsql: Introduce XLogRecPtrIsValid()

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Introduce XLogRecPtrIsValid()
Date: 2025-11-06 18:21:33
Message-ID: E1vH4c1-005KaK-1L@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Introduce XLogRecPtrIsValid()

XLogRecPtrIsInvalid() is inconsistent with the affirmative form of
macros used for other datatypes, and leads to awkward double negatives
in a few places. This commit introduces XLogRecPtrIsValid(), which
allows code to be written more naturally.

This patch only adds the new macro. XLogRecPtrIsInvalid() is left in
place, and all existing callers remain untouched. This means all
supported branches can accept hypothetical bug fixes that use the new
macro, and at the same time any code that compiled with the original
formulation will continue to silently compile just fine.

Author: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Backpatch-through: 13
Discussion: https://postgr.es/m/aQB7EvGqrbZXrMlg@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c0031d461324ca6063e96cc28ce78b75aa778112

Modified Files
--------------
src/include/access/xlogdefs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2025-11-06 19:35:28 pgsql: Use XLogRecPtrIsValid() in various places
Previous Message Álvaro Herrera 2025-11-06 16:37:21 pgsql: Refer readers of \? to "\? variables" for pset options