From 0305b337c7f86f92d571e90789bfb9d021941d5f Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Sat, 27 Apr 2024 11:41:45 +1200
Subject: [PATCH v2 09/11] Use streaming I/O in COPY via write-behind.

Since COPY uses BAS_BULKWRITE, in order to enable streaming write-behind
we just have to hand dirty buffers back to the BufferAccessStrategy.
---
 src/backend/access/heap/heapam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 4a4cf76269d..a8055087dca 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -2559,7 +2559,7 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
 							  VISIBILITYMAP_ALL_VISIBLE | VISIBILITYMAP_ALL_FROZEN);
 		}
 
-		UnlockReleaseBuffer(buffer);
+		StrategyUnlockReleaseBuffer(bistate ? bistate->strategy : NULL, buffer);
 		ndone += nthispage;
 
 		/*
-- 
2.44.0

