diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-03-24 10:33:14 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-03-24 11:33:02 +0100 |
commit | 280a408b48d5ee42969f981bceb9e9426c3a344c (patch) | |
tree | 07cb0ab7cfdbb369e76130ef2cff56f65d0285a2 /src/include/access/xact.h | |
parent | b2db277057a375ccbcc98cc3bbce8ce5b4d788ea (diff) | |
download | postgresql-280a408b48d5ee42969f981bceb9e9426c3a344c.tar.gz postgresql-280a408b48d5ee42969f981bceb9e9426c3a344c.zip |
Transaction chaining
Add command variants COMMIT AND CHAIN and ROLLBACK AND CHAIN, which
start new transactions with the same transaction characteristics as the
just finished one, per SQL standard.
Support for transaction chaining in PL/pgSQL is also added. This
functionality is especially useful when running COMMIT in a loop in
PL/pgSQL.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
Discussion: https://www.postgresql.org/message-id/flat/28536681-324b-10dc-ade8-ab46f7645a5a@2ndquadrant.com
Diffstat (limited to 'src/include/access/xact.h')
-rw-r--r-- | src/include/access/xact.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 426e77846f9..e8579dcd478 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -368,12 +368,14 @@ extern bool TransactionIdIsCurrentTransactionId(TransactionId xid); extern void CommandCounterIncrement(void); extern void ForceSyncCommit(void); extern void StartTransactionCommand(void); +extern void SaveTransactionCharacteristics(void); +extern void RestoreTransactionCharacteristics(void); extern void CommitTransactionCommand(void); extern void AbortCurrentTransaction(void); extern void BeginTransactionBlock(void); -extern bool EndTransactionBlock(void); +extern bool EndTransactionBlock(bool chain); extern bool PrepareTransactionBlock(const char *gid); -extern void UserAbortTransactionBlock(void); +extern void UserAbortTransactionBlock(bool chain); extern void BeginImplicitTransactionBlock(void); extern void EndImplicitTransactionBlock(void); extern void ReleaseSavepoint(const char *name); |