Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 56b21b7

Browse files
Re-classify ERRCODE_DATABASE_DROPPED to 57P04
1 parent 0c707aa commit 56b21b7

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

doc/src/sgml/errcodes.sgml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -985,11 +985,6 @@
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>
993988

994989
<row>
995990
<entry spanname="span13"><emphasis role="bold">Class 42 &mdash; Syntax Error or Access Rule Violation</></entry>
@@ -1374,6 +1369,12 @@
13741369
<entry>cannot_connect_now</entry>
13751370
</row>
13761371

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

13781379
<row>
13791380
<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
@@ -2916,7 +2916,7 @@ ProcessInterrupts(void)
29162916
Assert(RecoveryConflictReason == PROCSIG_RECOVERY_CONFLICT_DATABASE);
29172917
pgstat_report_recovery_conflict(RecoveryConflictReason);
29182918
ereport(FATAL,
2919-
(errcode(ERRCODE_T_R_DATABASE_DROPPED),
2919+
(errcode(ERRCODE_DATABASE_DROPPED),
29202920
errmsg("terminating connection due to conflict with recovery"),
29212921
errdetail_recovery_conflict()));
29222922
}

src/include/utils/errcodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@
243243
#define ERRCODE_T_R_SERIALIZATION_FAILURE MAKE_SQLSTATE('4','0', '0','0','1')
244244
#define ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN MAKE_SQLSTATE('4','0', '0','0','3')
245245
#define ERRCODE_T_R_DEADLOCK_DETECTED MAKE_SQLSTATE('4','0', 'P','0','1')
246-
#define ERRCODE_T_R_DATABASE_DROPPED MAKE_SQLSTATE('4','0', 'P','0','2')
247246

248247
/* Class 42 - Syntax Error or Access Rule Violation */
249248
#define ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION MAKE_SQLSTATE('4','2', '0','0','0')
@@ -333,6 +332,7 @@
333332
#define ERRCODE_ADMIN_SHUTDOWN MAKE_SQLSTATE('5','7', 'P','0','1')
334333
#define ERRCODE_CRASH_SHUTDOWN MAKE_SQLSTATE('5','7', 'P','0','2')
335334
#define ERRCODE_CANNOT_CONNECT_NOW MAKE_SQLSTATE('5','7', 'P','0','3')
335+
#define ERRCODE_DATABASE_DROPPED MAKE_SQLSTATE('5','7', 'P','0','4')
336336

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

src/pl/plpgsql/src/plerrcodes.h

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

486-
{
487-
"database_dropped", ERRCODE_T_R_DATABASE_DROPPED
488-
},
489-
490486
{
491487
"syntax_error_or_access_rule_violation", ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION
492488
},
@@ -739,6 +735,10 @@
739735
"cannot_connect_now", ERRCODE_CANNOT_CONNECT_NOW
740736
},
741737

738+
{
739+
"database_dropped", ERRCODE_DATABASE_DROPPED
740+
},
741+
742742
{
743743
"io_error", ERRCODE_IO_ERROR
744744
},

0 commit comments

Comments
 (0)