Re: Consistently use the XLogRecPtrIsInvalid() macro
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Quan Zongliang <quanzongliang@yeah.net>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-10-28T14:05:34Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Replace literal 0 with InvalidXLogRecPtr for XLogRecPtr assignments
- ec3174407164 19 (unreleased) landed
-
Replace pointer comparisons and assignments to literal zero with NULL
- ec782f56b0c3 19 (unreleased) landed
-
Use XLogRecPtrIsValid() in various places
- a2b02293bc65 19 (unreleased) landed
-
Introduce XLogRecPtrIsValid()
- d2965f627fe3 14.20 landed
- c0031d461324 18.1 landed
- 723cc84db50a 16.11 landed
- 49b45999f3b2 15.15 landed
- 33727aff18d0 17.7 landed
- 20bafb097288 13.23 landed
- 06edbed47862 19 (unreleased) landed
On 2025-Oct-28, Michael Paquier wrote: > 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. Well, we don't have to remove it right away. We can simply not use it. And maybe if the compiler supports it, make a static inline function in the header with the [[deprecated]] attribute or __attribute__((deprecated)) so that the tool developers get a warning and migrate to using the new one. Then in a few years we remove it. BTW we could use Coccinelle to replace all the XLogRecPtrIsInvalid() calls with !XLogRecPtrIsValid(), as well as all places comparing an LSN to InvalidXLogRecPtr or literal zero. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/