From 3cfa833fa3d8252e6fb0b50507651fee4869cdd7 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Thu, 2 Apr 2026 12:17:12 -0400
Subject: [PATCH v2 9/9] Don't include read_stream.h in heapam.h

heapam.h is still quite widely included...
---
 src/include/access/heapam.h              | 2 +-
 src/backend/access/heap/heapam.c         | 2 ++
 src/backend/access/heap/heapam_handler.c | 1 +
 src/backend/executor/execReplication.c   | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index 54067b828e4..0b9b379e20d 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -26,7 +26,6 @@
 #include "storage/bufpage.h"
 #include "storage/dsm.h"
 #include "storage/lockdefs.h"
-#include "storage/read_stream.h"
 #include "storage/shm_toc.h"
 #include "utils/relcache.h"
 #include "utils/snapshot.h"
@@ -49,6 +48,7 @@ typedef struct GlobalVisState GlobalVisState;
 typedef struct TupleTableSlot TupleTableSlot;
 typedef struct VacuumCutoffs VacuumCutoffs;
 typedef struct VacuumParams VacuumParams;
+typedef struct read_stream read_stream;
 
 #define MaxLockTupleMode	LockTupleExclusive
 
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 8c4fb04af19..18a3918f81b 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -45,10 +45,12 @@
 #include "commands/vacuum.h"
 #include "pgstat.h"
 #include "port/pg_bitutils.h"
+#include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "storage/predicate.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
+#include "storage/read_stream.h"
 #include "utils/datum.h"
 #include "utils/injection_point.h"
 #include "utils/inval.h"
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
index ad8220cb0f0..4bf74d8ca89 100644
--- a/src/backend/access/heap/heapam_handler.c
+++ b/src/backend/access/heap/heapam_handler.c
@@ -43,6 +43,7 @@
 #include "storage/lock.h"
 #include "storage/predicate.h"
 #include "storage/procarray.h"
+#include "storage/read_stream.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
 #include "utils/rel.h"
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c
index b2ca5cbf117..bb12d191216 100644
--- a/src/backend/executor/execReplication.c
+++ b/src/backend/executor/execReplication.c
@@ -29,6 +29,7 @@
 #include "executor/nodeModifyTable.h"
 #include "replication/conflict.h"
 #include "replication/logicalrelation.h"
+#include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
-- 
2.53.0.1.gb2826b52eb

