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

Commit9e95c9a

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_T_R_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, edits by me, review by Robert Haas
1 parent44df84d commit9e95c9a

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

‎doc/src/sgml/errcodes.sgml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,11 @@
985985
<entry>deadlock_detected</entry>
986986
</row>
987987

988+
<row>
989+
<entry><literal>40P02</literal></entry>
990+
<entry>DATABASE DROPPED</entry>
991+
<entry>database_dropped</entry>
992+
</row>
988993

989994
<row>
990995
<entry spanname="span13"><emphasis role="bold">Class 42 &mdash; Syntax Error or Access Rule Violation</></entry>

‎src/backend/tcop/postgres.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2912,9 +2912,11 @@ ProcessInterrupts(void)
29122912
}
29132913
elseif (RecoveryConflictPending)
29142914
{
2915+
/* Currently there is only one non-retryable recovery conflict */
2916+
Assert(RecoveryConflictReason==PROCSIG_RECOVERY_CONFLICT_DATABASE);
29152917
pgstat_report_recovery_conflict(RecoveryConflictReason);
29162918
ereport(FATAL,
2917-
(errcode(ERRCODE_ADMIN_SHUTDOWN),
2919+
(errcode(ERRCODE_T_R_DATABASE_DROPPED),
29182920
errmsg("terminating connection due to conflict with recovery"),
29192921
errdetail_recovery_conflict()));
29202922
}

‎src/include/utils/errcodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
#defineERRCODE_T_R_SERIALIZATION_FAILUREMAKE_SQLSTATE('4','0', '0','0','1')
244244
#defineERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWNMAKE_SQLSTATE('4','0', '0','0','3')
245245
#defineERRCODE_T_R_DEADLOCK_DETECTEDMAKE_SQLSTATE('4','0', 'P','0','1')
246+
#defineERRCODE_T_R_DATABASE_DROPPEDMAKE_SQLSTATE('4','0', 'P','0','2')
246247

247248
/* Class 42 - Syntax Error or Access Rule Violation */
248249
#defineERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATIONMAKE_SQLSTATE('4','2', '0','0','0')

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@
483483
"deadlock_detected",ERRCODE_T_R_DEADLOCK_DETECTED
484484
},
485485

486+
{
487+
"database_dropped",ERRCODE_T_R_DATABASE_DROPPED
488+
},
489+
486490
{
487491
"syntax_error_or_access_rule_violation",ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION
488492
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp