From 280a408b48d5ee42969f981bceb9e9426c3a344c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 24 Mar 2019 10:33:14 +0100 Subject: 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 Discussion: https://www.postgresql.org/message-id/flat/28536681-324b-10dc-ade8-ab46f7645a5a@2ndquadrant.com --- doc/src/sgml/ref/commit.sgml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'doc/src/sgml/ref/commit.sgml') diff --git a/doc/src/sgml/ref/commit.sgml b/doc/src/sgml/ref/commit.sgml index b2e8d5d1807..e4169cd2c62 100644 --- a/doc/src/sgml/ref/commit.sgml +++ b/doc/src/sgml/ref/commit.sgml @@ -21,7 +21,7 @@ PostgreSQL documentation -COMMIT [ WORK | TRANSACTION ] +COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ] @@ -38,6 +38,10 @@ COMMIT [ WORK | TRANSACTION ] Parameters + + chained transactions + + WORK @@ -48,6 +52,18 @@ COMMIT [ WORK | TRANSACTION ] + + + AND CHAIN + + + If AND CHAIN is specified, a new transaction is + immediately started with the same transaction characteristics (see ) as the just finished one. Otherwise, + no new transaction is started. + + + @@ -79,9 +95,8 @@ COMMIT; Compatibility - The SQL standard only specifies the two forms - COMMIT and COMMIT - WORK. Otherwise, this command is fully conforming. + The command COMMIT conforms to the SQL standard. The + form COMMIT TRANSACTION is a PostgreSQL extension. -- cgit v1.2.3