Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd6c1dc1

Browse files
Create new errcode for recovery conflict caused by db drop on master.
Previously reported as ERRCODE_ADMIN_SHUTDOWN, this case is nowreported as ERRCODE_DATABASE_DROPPED. No message text change.Unlikely to happen on most servers, so low impact change to allowsession poolers to correctly handle this situation.Tatsuo Ishii and Simon Riggs
1 parent9a01285 commitd6c1dc1

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

‎doc/src/sgml/errcodes.sgml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@
13691369
<entry>cannot_connect_now</entry>
13701370
</row>
13711371

1372+
<row>
1373+
<entry><literal>57P04</literal></entry>
1374+
<entry>DATABASE DROPPED</entry>
1375+
<entry>database_dropped</entry>
1376+
</row>
1377+
13721378

13731379
<row>
13741380
<entry spanname="span13"><emphasis role="bold">Class 58 &mdash; System Error (errors external to <productname>PostgreSQL</> itself)</></entry>

‎src/backend/tcop/postgres.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2908,7 +2908,7 @@ ProcessInterrupts(void)
29082908
errdetail_recovery_conflict()));
29092909
elseif (RecoveryConflictPending)
29102910
ereport(FATAL,
2911-
(errcode(ERRCODE_ADMIN_SHUTDOWN),
2911+
(errcode(ERRCODE_DATABASE_DROPPED),
29122912
errmsg("terminating connection due to conflict with recovery"),
29132913
errdetail_recovery_conflict()));
29142914
else

‎src/include/utils/errcodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@
332332
#defineERRCODE_ADMIN_SHUTDOWNMAKE_SQLSTATE('5','7', 'P','0','1')
333333
#defineERRCODE_CRASH_SHUTDOWNMAKE_SQLSTATE('5','7', 'P','0','2')
334334
#defineERRCODE_CANNOT_CONNECT_NOWMAKE_SQLSTATE('5','7', 'P','0','3')
335+
#defineERRCODE_DATABASE_DROPPEDMAKE_SQLSTATE('5','7', 'P','0','4')
335336

336337
/* Class 58 - System Error (class borrowed from DB2) */
337338
/* (we define this as errors external to PostgreSQL itself) */

‎src/pl/plpgsql/src/plerrcodes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,10 @@
735735
"cannot_connect_now",ERRCODE_CANNOT_CONNECT_NOW
736736
},
737737

738+
{
739+
"database_dropped",ERRCODE_DATABASE_DROPPED
740+
},
741+
738742
{
739743
"io_error",ERRCODE_IO_ERROR
740744
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp