diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-11-28 09:43:24 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-11-28 09:43:24 +0900 |
commit | 6d1183515e4fca753eea69b0349766e81248bdb4 (patch) | |
tree | a8ea94041cc0ff16b5a9f20dabe532ddfee9a238 /src/backend/access/transam/xact.c | |
parent | 3bbfa2ef785a36c6aa48d9a7780274dcbc6d63fd (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.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 20ebc24194f..7a3d9b4b012 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -3490,6 +3490,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) @@ -3600,6 +3610,9 @@ IsInTransactionBlock(bool isTopLevel) if (IsSubTransaction()) return true; + if (MyXactFlags & XACT_FLAGS_PIPELINING) + return true; + if (!isTopLevel) return true; |