From 8585ad36254199ca63700707ee78890da1755e4d Mon Sep 17 00:00:00 2001
From: Simon Riggs <simon@2ndQuadrant.com>
Date: Mon, 31 Jan 2011 19:20:23 +0000
Subject: [PATCH] Fix error code for canceling statement due to conflict with
 recovery. All retryable conflict errors now have an error code that indicates
 that a retry is possible, correcting my incomplete fix of 2010/05/12

Tatsuo Ishii and Simon Riggs, input from Robert Haas and Florian Pflug
---
 src/backend/storage/ipc/standby.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 8d827464d95..a92ae4af590 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -494,7 +494,7 @@ CheckRecoveryConflictDeadlock(LWLockId partitionLock)
 	 * process will continue to wait even though we have avoided deadlock.
 	 */
 	ereport(ERROR,
-			(errcode(ERRCODE_QUERY_CANCELED),
+			(errcode(ERRCODE_T_R_DEADLOCK_DETECTED),
 			 errmsg("canceling statement due to conflict with recovery"),
 	   errdetail("User transaction caused buffer deadlock with recovery.")));
 }
-- 
GitLab