From 472387d5a1443198e5b22a3db332b7e1fee779a9 Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <postgres@jeltef.nl>
Date: Sat, 28 Nov 2026 21:15:39 +0100
Subject: [PATCH v2 7/7] Don't pass the current memory context to hash_make

Four hash_make() calls passed a memory context that the surrounding
code had already switched to. Since hash_make() uses
CurrentMemoryContext by default, like palloc() does for the other
allocations in those functions, the argument was redundant.
---
 src/backend/access/heap/rewriteheap.c | 6 ++----
 src/backend/partitioning/partdesc.c   | 3 +--
 src/backend/postmaster/autovacuum.c   | 3 +--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 77dad139bc9..8152f4b4e39 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -268,13 +268,11 @@ begin_heap_rewrite(Relation old_heap, Relation new_heap, TransactionId oldest_xm
 	 */
 	state->rs_unresolved_tups =
 		hash_make(UnresolvedTupData, key,
-				  "Rewrite / Unresolved ctids", 128,
-				  .mcxt = state->rs_cxt);
+				  "Rewrite / Unresolved ctids", 128);
 
 	state->rs_old_new_tid_map =
 		hash_make(OldToNewMappingData, key,
-				  "Rewrite / Old to new tid map", 128,
-				  .mcxt = state->rs_cxt);
+				  "Rewrite / Old to new tid map", 128);
 
 	MemoryContextSwitchTo(old_cxt);
 
diff --git a/src/backend/partitioning/partdesc.c b/src/backend/partitioning/partdesc.c
index 312209bd82a..d852abb9030 100644
--- a/src/backend/partitioning/partdesc.c
+++ b/src/backend/partitioning/partdesc.c
@@ -428,8 +428,7 @@ CreatePartitionDirectory(MemoryContext mcxt, bool omit_detached)
 	pdir->pdir_mcxt = mcxt;
 
 	pdir->pdir_hash = hash_make(PartitionDirectoryEntry, reloid,
-								"partition directory", 256,
-								.mcxt = mcxt);
+								"partition directory", 256);
 	pdir->omit_detached = omit_detached;
 
 	MemoryContextSwitchTo(oldcontext);
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 50b66eec704..d15a8404132 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -960,8 +960,7 @@ rebuild_database_list(Oid newdb)
 	 */
 	dbhash = hash_make(avl_dbase, adl_datid,
 					   "autovacuum db hash",
-					   20,		/* magic number here FIXME */
-					   .mcxt = tmpcxt);
+					   20);		/* magic number here FIXME */
 
 	/* start by inserting the new database */
 	score = 0;
-- 
2.56.1

