summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-11-28 09:43:28 +0900
committerMichael Paquier <michael@paquier.xyz>2024-11-28 09:43:28 +0900
commit24da0e761837fc0c0ef5733519595c848e5fe280 (patch)
treec9026473e56e6a6093887dfc76744d36a878ca54 /src/backend/access/transam/xact.c
parentf1cb5e51f32960d336d55429f0f172e853043c18 (diff)
Revert "Handle better implicit transaction state of pipeline mode"
This reverts commit d77f91214fb7 on all stable branches, due to concerns regarding the compatility side effects this could create in a minor release. The change still exists on HEAD. Discussion: https://postgr.es/m/CA+TgmoZqRgeFTg4+Yf_CMRRXiHuNz1u6ZC4FvVk+rxw0RmOPnw@mail.gmail.com Backpatch-through: 13
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 423545e6038..ffe26e26f66 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -3406,6 +3406,16 @@ PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
stmtType)));
/*
+ * inside a pipeline that has started an implicit transaction?
+ */
+ if (MyXactFlags & XACT_FLAGS_PIPELINING)
+ ereport(ERROR,
+ (errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),
+ /* translator: %s represents an SQL statement name */
+ errmsg("%s cannot be executed within a pipeline",
+ stmtType)));
+
+ /*
* inside a function call?
*/
if (!isTopLevel)
@@ -3516,6 +3526,9 @@ IsInTransactionBlock(bool isTopLevel)
if (IsSubTransaction())
return true;
+ if (MyXactFlags & XACT_FLAGS_PIPELINING)
+ return true;
+
if (!isTopLevel)
return true;