From a2b516dab9b90007c1b65988d91222c4582adea8 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Thu, 31 May 2012 13:11:47 +0100 Subject: [PATCH] Only throw recovery conflicts when InHotStandby. Bug fix to recent patch to allow Index Only Scans on Hot Standby. Bug report from Jaime Casanova --- src/backend/access/heap/heapam.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 0c67156390..ce52e2dd48 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -4725,7 +4725,8 @@ heap_xlog_visible(XLogRecPtr lsn, XLogRecord *record) * forces any index-only scan that is in flight to perform heap fetches, * rather than killing the transaction outright. */ - ResolveRecoveryConflictWithSnapshot(xlrec->cutoff_xid, xlrec->node); + if (InHotStandby) + ResolveRecoveryConflictWithSnapshot(xlrec->cutoff_xid, xlrec->node); LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);