Subject: [PATCH] Miscellaneous little fixes

From: Aleksander Alekseev <[email-masked]>
Date: Tue, 14 Apr 2026 18:20:41 +0300

Hi,

I noticed several little defects in the code:

1. There are several typos in the comments: "fist" instead of "first"
2. The comment in network.c claims that IPv6 has 64 bits (in fact 128)
3. oid_hash macro is not used for a long time and can be removed.

Here is the patch.

-- 
Best regards,
Aleksander Alekseev
From 0c1c8e1228b6487a4ecee21d2d00799603625445 Mon Sep 17 00:00:00 2001
From: Aleksander Alekseev <[email-masked]>
Date: Tue, 14 Apr 2026 17:59:58 +0300
Subject: [PATCH v1] Miscellaneous little fixes

- Fix two "fist" typos in comments in hyperloglog.c and indxpath.c.
- Fix incorrect IPv6 address width in a comment in network.c: IPv6  addresses
  are 128 bits, not 64.
- Remove the oid_hash macro from hashfn.h. The last real caller was removed
  in commit 4a14f13a0ab in December 2014, which also added the "Remove me
  eventually" notice.

Author: Aleksander Alekseev <[email-masked]>
Reviewed-by: TODO FIXME
Discussion: TODO FIXME
---
 src/backend/lib/hyperloglog.c         | 2 +-
 src/backend/optimizer/path/indxpath.c | 2 +-
 src/backend/utils/adt/network.c       | 2 +-
 src/backend/utils/hash/dynahash.c     | 2 +-
 src/include/common/hashfn.h           | 2 --
 5 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/backend/lib/hyperloglog.c b/src/backend/lib/hyperloglog.c
index c74f11217ef..3bc6aa0548f 100644
--- a/src/backend/lib/hyperloglog.c
+++ b/src/backend/lib/hyperloglog.c
@@ -228,7 +228,7 @@ estimateHyperLogLog(hyperLogLogState *cState)
  * starting from the first, reading from most significant to least significant
  * bits.
  *
- * Example (when considering fist 10 bits of x):
+ * Example (when considering first 10 bits of x):
  *
  * rho(x = 0b1000000000)   returns 1
  * rho(x = 0b0010000000)   returns 3
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 430e06dcaaa..f76a5373c4b 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -1187,7 +1187,7 @@ typedef struct
 	Oid			inputcollid;	/* OID of the OpClause input collation */
 	int			argindex;		/* index of the clause in the list of
 								 * arguments */
-	int			groupindex;		/* value of argindex for the fist clause in
+	int			groupindex;		/* value of argindex for the first clause in
 								 * the group of similar clauses */
 } OrArgIndexMatch;
 
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c
index c7e0828764e..f4bf9c3b532 100644
--- a/src/backend/utils/adt/network.c
+++ b/src/backend/utils/adt/network.c
@@ -551,7 +551,7 @@ network_abbrev_abort(int memtupcount, SortSupport ssup)
  * all their subnet bits *must* be zero (1.2.3.0/24).
  *
  * IPv4 and IPv6 are identical in this makeup, with the difference being that
- * IPv4 addresses have a maximum of 32 bits compared to IPv6's 64 bits, so in
+ * IPv4 addresses have a maximum of 32 bits compared to IPv6's 128 bits, so in
  * IPv6 each part may be larger.
  *
  * inet/cidr types compare using these sorting rules. If inequality is detected
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 20610f96e7b..dd3e50d6654 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -346,7 +346,7 @@ string_compare(const char *key1, const char *key2, Size keysize)
  * Neither tabname nor *info need persist after the hash_create() call.
  *
  * Note: It is deprecated for callers of hash_create() to explicitly specify
- * string_hash, tag_hash, uint32_hash, or oid_hash.  Just set HASH_STRINGS or
+ * string_hash, tag_hash, or uint32_hash.  Just set HASH_STRINGS or
  * HASH_BLOBS.  Use HASH_FUNCTION only when you want something other than
  * one of these.
  *
diff --git a/src/include/common/hashfn.h b/src/include/common/hashfn.h
index a40434f798f..222f1d0d249 100644
--- a/src/include/common/hashfn.h
+++ b/src/include/common/hashfn.h
@@ -56,8 +56,6 @@ extern uint32 string_hash(const void *key, Size keysize);
 extern uint32 tag_hash(const void *key, Size keysize);
 extern uint32 uint32_hash(const void *key, Size keysize);
 
-#define oid_hash uint32_hash	/* Remove me eventually */
-
 /*
  * Combine two 32-bit hash values, resulting in another hash value, with
  * decent bit mixing.
-- 
2.43.0

---

From: Michael Paquier <[email-masked]>
Date: Wed, 15 Apr 2026 06:28:52 +0900

> 3. oid_hash macro is not used for a long time and can be removed.

There is no cost in keeping it, and removing it could break some
extension code out there..

Picked up the rest in a staging branch.
--
Michael

---

From: David Rowley <[email-masked]>
Date: Wed, 15 Apr 2026 10:41:28 +1200

> Picked up the rest in a staging branch.

One more in [1] and one I noticed a while ago attached, if you feel
like including those too.

David

[1] https://postgr.es/m/CA+3i_M8QOnjeG1GN+rqncnF52-Uo5fr+b=[email-masked]

---

From: Michael Paquier <[email-masked]>
Date: Wed, 15 Apr 2026 09:47:19 +0900

> like including those too.

Thanks.  I have grabbed these two.
--
Michael

---

From: Chao Li <[email-masked]>
Date: Wed, 15 Apr 2026 08:56:02 +0800

> On Apr 15, 2026, at 08:47, Michael Paquier <[email-masked]> wrote:
> 

Maybe add this one, see the attached diff file. This is an oversight of 82467f627bd478569de04f4a3f1993098e80c812. I ever notified the author about this typo, but I guess he missed my message.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

---

From: Michael Paquier <[email-masked]>
Date: Wed, 15 Apr 2026 13:55:42 +0900

On Wed, Apr 15, 2026 at 08:56:02AM +0800, Chao Li wrote:
> Maybe add this one, see the attached diff file. This is an oversight
> of 82467f627bd478569de04f4a3f1993098e80c812. I ever notified the
> author about this typo, but I guess he missed my message. 

That sounds about right.
--
Michael

---

From: Aleksander Alekseev <[email-masked]>
Date: Wed, 15 Apr 2026 11:18:28 +0300

Hi Michael,

Thanks for picking this up.

> extension code out there..

Of course it's up to you to decide, but I wanted to point out the
comment written in 2014 says:

/* Remove me eventually */

... soooooo. IMO 12 years is quite enough for eventually and for a
line of code that is not covered by any tests :)

-- 
Best regards,
Aleksander Alekseev