agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Subject: [PATCH v1 1/5] Replace literal 0 with InvalidMultiXactId for MultiXactId assignments
Date: Thu, 12 Feb 2026 09:08:15 +0000

Use the proper constant InvalidMultiXactId instead of literal 0 when
assigning MultiXactId variables and struct fields.

This improves code clarity by making it explicit that these are
invalid MultiXactId values rather than ambiguous zero literals.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion:
---
 src/bin/pg_resetwal/pg_resetwal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 100.0% src/bin/pg_resetwal/

diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
index 85dc43d4cdb..697bed096bd 100644
--- a/src/bin/pg_resetwal/pg_resetwal.c
+++ b/src/bin/pg_resetwal/pg_resetwal.c
@@ -86,7 +86,7 @@ static Oid	next_oid_val;
 
 static bool mxids_given = false;
 static MultiXactId next_mxid_val;
-static MultiXactId oldest_mxid_val = 0;
+static MultiXactId oldest_mxid_val = InvalidMultiXactId;
 
 static bool next_mxoff_given = false;
 static MultiXactOffset next_mxoff_val;
-- 
2.34.1


--A7qqtM/5Ou92K2X7
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v1-0002-Replace-literal-0-with-InvalidOffsetNumber-for-Of.patch"



view thread (3+ 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: pgsql-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com
  Subject: Re: [PATCH v1 1/5] Replace literal 0 with InvalidMultiXactId for MultiXactId assignments
  In-Reply-To: <no-message-id-600067@localhost>

* 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