]> granicus.if.org Git - postgresql/commitdiff
Only throw recovery conflicts when InHotStandby. Bug fix to recent
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 31 May 2012 12:11:47 +0000 (13:11 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 31 May 2012 12:11:47 +0000 (13:11 +0100)
patch to allow Index Only Scans on Hot Standby.

Bug report from Jaime Casanova

src/backend/access/heap/heapam.c

index 0c67156390a6a1bf1fee0bb39b96e0da8cd55dbb..ce52e2dd48ed8e4cbdad1fdf0acb4c8ec27f01dd 100644 (file)
@@ -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);