aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2011-02-01 00:20:53 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2011-02-01 00:20:53 +0000
commit9e95c9ad558bafa26efbab50f77929de4ade5f90 (patch)
tree6226a5501878b76b154c01a611aef6656ebfb8f0 /src/backend/tcop/postgres.c
parent44df84df72b5eb43384bc7288713c2f80db7273d (diff)
downloadpostgresql-9e95c9ad558bafa26efbab50f77929de4ade5f90.tar.gz
postgresql-9e95c9ad558bafa26efbab50f77929de4ade5f90.zip
Create new errcode for recovery conflict caused by db drop on master.
Previously reported as ERRCODE_ADMIN_SHUTDOWN, this case is now reported as ERRCODE_T_R_DATABASE_DROPPED. No message text change. Unlikely to happen on most servers, so low impact change to allow session poolers to correctly handle this situation. Tatsuo Ishii, edits by me, review by Robert Haas
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 535926a937a..f6ccbb95243 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -2912,9 +2912,11 @@ ProcessInterrupts(void)
}
else if (RecoveryConflictPending)
{
+ /* Currently there is only one non-retryable recovery conflict */
+ Assert(RecoveryConflictReason == PROCSIG_RECOVERY_CONFLICT_DATABASE);
pgstat_report_recovery_conflict(RecoveryConflictReason);
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
+ (errcode(ERRCODE_T_R_DATABASE_DROPPED),
errmsg("terminating connection due to conflict with recovery"),
errdetail_recovery_conflict()));
}