0001-Add-a-new-error-code-ERRCODE_QUERY_CANCELED_HS-for-u.patch
text/x-patch
Filename: 0001-Add-a-new-error-code-ERRCODE_QUERY_CANCELED_HS-for-u.patch
Type: text/x-patch
Part: 1
Message:
subtransaction cancellation in HS
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: format-patch
Series: patch 0001
Subject: Add a new error code ERRCODE_QUERY_CANCELED_HS for use with HS indicating a failure that is more than a plain ERRCODE_QUERY_CANCELED - namely it should not be caught from various places like savepoints and in PLs.
| File | + | − |
|---|---|---|
| src/backend/tcop/postgres.c | 0 | 0 |
| src/include/utils/errcodes.h | 0 | 0 |
From 9d421934f737f607d550d95f5e64b630c143f013 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Mon, 11 Jan 2010 17:43:01 +0100
Subject: [PATCH 1/2] Add a new error code ERRCODE_QUERY_CANCELED_HS for use with HS indicating a failure
that is more than a plain ERRCODE_QUERY_CANCELED - namely it should not be caught from
various places like savepoints and in PLs.
In want for a better name.
---
src/backend/tcop/postgres.c | 4 ++--
src/include/utils/errcodes.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 8c0c8b9..67fa16b 100644
*** a/src/backend/tcop/postgres.c
--- b/src/backend/tcop/postgres.c
*************** ProcessInterrupts(void)
*** 2947,2959 ****
*/
silent_error_while_idle = true;
ereport(ERROR | LOG_NO_CLIENT,
! (errcode(ERRCODE_QUERY_CANCELED),
errmsg("canceling statement due to conflict with recovery"),
errdetail_recovery_conflict()));
}
else{
ereport(ERROR,
! (errcode(ERRCODE_QUERY_CANCELED),
errmsg("canceling statement due to conflict with recovery"),
errdetail_recovery_conflict()));
}
--- 2947,2959 ----
*/
silent_error_while_idle = true;
ereport(ERROR | LOG_NO_CLIENT,
! (errcode(ERRCODE_QUERY_CANCELED_HS),
errmsg("canceling statement due to conflict with recovery"),
errdetail_recovery_conflict()));
}
else{
ereport(ERROR,
! (errcode(ERRCODE_QUERY_CANCELED_HS),
errmsg("canceling statement due to conflict with recovery"),
errdetail_recovery_conflict()));
}
diff --git a/src/include/utils/errcodes.h b/src/include/utils/errcodes.h
index 52c09ca..279f0e4 100644
*** a/src/include/utils/errcodes.h
--- b/src/include/utils/errcodes.h
***************
*** 328,333 ****
--- 328,334 ----
/* Class 57 - Operator Intervention (class borrowed from DB2) */
#define ERRCODE_OPERATOR_INTERVENTION MAKE_SQLSTATE('5','7', '0','0','0')
#define ERRCODE_QUERY_CANCELED MAKE_SQLSTATE('5','7', '0','1','4')
+ #define ERRCODE_QUERY_CANCELED_HS MAKE_SQLSTATE('5','7', '0','1','5')
#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')
--
1.6.5.12.gd65df24