pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Transaction chaining
Date: Sun, 24 Mar 2019 10:43:01 +0000
Message-ID: <E1h80aj-0008S0-4U@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/280a408b48d5ee42969f981bceb9e9426c3a344c

Modified Files
--------------
doc/src/sgml/plpgsql.sgml                          |  14 ++
doc/src/sgml/ref/abort.sgml                        |  14 +-
doc/src/sgml/ref/commit.sgml                       |  23 ++-
doc/src/sgml/ref/end.sgml                          |  14 +-
doc/src/sgml/ref/rollback.sgml                     |  23 ++-
doc/src/sgml/spi.sgml                              |  29 +++-
src/backend/access/transam/xact.c                  |  73 +++++++-
src/backend/catalog/sql_features.txt               |   2 +-
src/backend/executor/spi.c                         |  50 +++++-
src/backend/nodes/copyfuncs.c                      |   1 +
src/backend/nodes/equalfuncs.c                     |   1 +
src/backend/parser/gram.y                          |  19 +-
src/backend/tcop/utility.c                         |   4 +-
src/bin/psql/tab-complete.c                        |   8 +-
src/include/access/xact.h                          |   6 +-
src/include/executor/spi.h                         |   2 +
src/include/nodes/parsenodes.h                     |   1 +
.../plpgsql/src/expected/plpgsql_transaction.out   |  28 +++
src/pl/plpgsql/src/pl_exec.c                       |  18 +-
src/pl/plpgsql/src/pl_funcs.c                      |  10 +-
src/pl/plpgsql/src/pl_gram.y                       |  18 +-
src/pl/plpgsql/src/pl_unreserved_kwlist.h          |   2 +
src/pl/plpgsql/src/plpgsql.h                       |   2 +
src/pl/plpgsql/src/sql/plpgsql_transaction.sql     |  23 +++
src/test/regress/expected/transactions.out         | 191 +++++++++++++++++++++
src/test/regress/sql/transactions.sql              |  63 +++++++
26 files changed, 601 insertions(+), 38 deletions(-)



Message-ID: <E1h80aj-0008S0-4U@gemulon.postgresql.org>
Permalink:  ../E1h80aj-0008S0-4U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h80aj-0008S0-4U@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Transaction chaining
  In-Reply-To: <E1h80aj-0008S0-4U@gemulon.postgresql.org>
  References: <E1h80aj-0008S0-4U@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox