From ebc5e04f83bd0dbb1735ca7571c71859b15fca7e Mon Sep 17 00:00:00 2001
From: Melanie Plageman <melanieplageman@gmail.com>
Date: Mon, 10 Jun 2024 12:40:58 -0400
Subject: [PATCH v22b 11/29] BitmapHeapScan: Make prefetch sync error more
 detailed

Add the prefetch and current block numbers to the error message emitted
when the prefetch iterator gets out of sync with the main iterator in
serial bitmap table scan.
---
 src/backend/executor/nodeBitmapHeapscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index 7ca986ae5b2..d638b73b7d2 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -267,7 +267,7 @@ new_page:
 			 * field directly? */
 			!node->prefetch_iterator.exhausted &&
 			node->pfblockno < node->blockno)
-			elog(ERROR, "prefetch and main iterators are out of sync");
+			elog(ERROR, "prefetch and main iterators are out of sync. pfblockno: %d. blockno: %d", node->pfblockno, node->blockno);
 
 		/* Adjust the prefetch target */
 		BitmapAdjustPrefetchTarget(node);
-- 
2.45.2

