mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
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_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 and Simon Riggs
This commit is contained in:
parent
9a01285289
commit
d6c1dc176a
@ -1369,6 +1369,12 @@
|
||||
<entry>cannot_connect_now</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal>57P04</literal></entry>
|
||||
<entry>DATABASE DROPPED</entry>
|
||||
<entry>database_dropped</entry>
|
||||
</row>
|
||||
|
||||
|
||||
<row>
|
||||
<entry spanname="span13"><emphasis role="bold">Class 58 — System Error (errors external to <productname>PostgreSQL</> itself)</></entry>
|
||||
|
@ -2908,7 +2908,7 @@ ProcessInterrupts(void)
|
||||
errdetail_recovery_conflict()));
|
||||
else if (RecoveryConflictPending)
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_ADMIN_SHUTDOWN),
|
||||
(errcode(ERRCODE_DATABASE_DROPPED),
|
||||
errmsg("terminating connection due to conflict with recovery"),
|
||||
errdetail_recovery_conflict()));
|
||||
else
|
||||
|
@ -332,6 +332,7 @@
|
||||
#define ERRCODE_ADMIN_SHUTDOWN MAKE_SQLSTATE('5','7', 'P','0','1')
|
||||
#define ERRCODE_CRASH_SHUTDOWN MAKE_SQLSTATE('5','7', 'P','0','2')
|
||||
#define ERRCODE_CANNOT_CONNECT_NOW MAKE_SQLSTATE('5','7', 'P','0','3')
|
||||
#define ERRCODE_DATABASE_DROPPED MAKE_SQLSTATE('5','7', 'P','0','4')
|
||||
|
||||
/* Class 58 - System Error (class borrowed from DB2) */
|
||||
/* (we define this as errors external to PostgreSQL itself) */
|
||||
|
@ -735,6 +735,10 @@
|
||||
"cannot_connect_now", ERRCODE_CANNOT_CONNECT_NOW
|
||||
},
|
||||
|
||||
{
|
||||
"database_dropped", ERRCODE_DATABASE_DROPPED
|
||||
},
|
||||
|
||||
{
|
||||
"io_error", ERRCODE_IO_ERROR
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user