mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Revert "Handle better implicit transaction state of pipeline mode"
This reverts commit d77f91214f 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
This commit is contained in:
@@ -3500,6 +3500,16 @@ PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
|
||||
errmsg("%s cannot run inside a subtransaction",
|
||||
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?
|
||||
*/
|
||||
@@ -3611,6 +3621,9 @@ IsInTransactionBlock(bool isTopLevel)
|
||||
if (IsSubTransaction())
|
||||
return true;
|
||||
|
||||
if (MyXactFlags & XACT_FLAGS_PIPELINING)
|
||||
return true;
|
||||
|
||||
if (!isTopLevel)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user