Subject: Re: Consistently use the XLogRecPtrIsInvalid() macro

From: Álvaro Herrera <[email-masked]>
Date: Thu, 29 Jan 2026 18:45:12 +0100

On 2025-Nov-17, Bertrand Drouvot wrote:

> On Mon, Nov 17, 2025 at 01:12:24PM +0000, Bertrand Drouvot wrote:
> > The script has been updated and the patch too (finding a new replacement in
> > gist.c).
> 
> Finally, adding GistNSN to the game (as a typedef XLogRecPtr) gives the attached.

I've pushed this.  Hopefully it won't upset anything.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
Officer Krupke, what are we to do?
Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")

---

From: Bertrand Drouvot <[email-masked]>
Date: Fri, 30 Jan 2026 11:16:26 +0000

Hi,

On Thu, Jan 29, 2026 at 06:45:12PM +0100, Álvaro Herrera wrote:
> I've pushed this.

Thanks!

I just looked at the cocci script used for that and realized (with more Coccinelle
practice) that it could be simplified. It's done in [1], and lead to a few more
cases discovered and fixed in the attached. I think that, with the attached, we
cover them all.

[1]: https://github.com/bdrouvot/coccinelle_on_pg/blob/main/replace_literal_0_assignement_with_InvalidXLogRecPtr.cocci

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com