sr_error_code.patch
text/x-patch
Filename: sr_error_code.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| doc/src/sgml/errcodes.sgml | 5 | 0 |
| src/backend/tcop/postgres.c | 1 | 0 |
| src/include/utils/errcodes.h | 1 | 0 |
| src/pl/plpgsql/src/plerrcodes.h | 4 | 0 |
*** a/doc/src/sgml/errcodes.sgml
--- b/doc/src/sgml/errcodes.sgml
***************
*** 985,990 ****
--- 985,995 ----
<entry>deadlock_detected</entry>
</row>
+ <row>
+ <entry><literal>40P02</literal></entry>
+ <entry>CONFLICT WITH RECOVERY</entry>
+ <entry>conflict_with_recovery</entry>
+ </row>
<row>
<entry spanname="span13"><emphasis role="bold">Class 42 — Syntax Error or Access Rule Violation</></entry>
*** a/src/backend/tcop/postgres.c
--- b/src/backend/tcop/postgres.c
***************
*** 2909,2915 **** ProcessInterrupts(void)
errdetail_recovery_conflict()));
else if (RecoveryConflictPending)
ereport(FATAL,
! (errcode(ERRCODE_ADMIN_SHUTDOWN),
errmsg("terminating connection due to conflict with recovery"),
errdetail_recovery_conflict()));
else
--- 2909,2915 ----
errdetail_recovery_conflict()));
else if (RecoveryConflictPending)
ereport(FATAL,
! (errcode(ERRCODE_CONFLICT_WITH_RECOVERY),
errmsg("terminating connection due to conflict with recovery"),
errdetail_recovery_conflict()));
else
*** a/src/include/utils/errcodes.h
--- b/src/include/utils/errcodes.h
***************
*** 243,248 ****
--- 243,249 ----
#define ERRCODE_T_R_SERIALIZATION_FAILURE MAKE_SQLSTATE('4','0', '0','0','1')
#define ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN MAKE_SQLSTATE('4','0', '0','0','3')
#define ERRCODE_T_R_DEADLOCK_DETECTED MAKE_SQLSTATE('4','0', 'P','0','1')
+ #define ERRCODE_CONFLICT_WITH_RECOVERY MAKE_SQLSTATE('4','0', 'P','0','2')
/* Class 42 - Syntax Error or Access Rule Violation */
#define ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION MAKE_SQLSTATE('4','2', '0','0','0')
*** a/src/pl/plpgsql/src/plerrcodes.h
--- b/src/pl/plpgsql/src/plerrcodes.h
***************
*** 484,489 ****
--- 484,493 ----
},
{
+ "conflict_with_recovery", ERRCODE_CONFLICT_WITH_RECOVERY
+ },
+
+ {
"syntax_error_or_access_rule_violation", ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION
},