pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: PL/pgSQL: Nested CALL with transactions
Date: Wed, 28 Mar 2018 17:34:34 +0000
Message-ID: <E1f1Ey2-0000Yr-2e@gemulon.postgresql.org> (raw)

PL/pgSQL: Nested CALL with transactions

So far, a nested CALL or DO in PL/pgSQL would not establish a context
where transaction control statements were allowed.  This fixes that by
handling CALL and DO specially in PL/pgSQL, passing the atomic/nonatomic
execution context through and doing the required management around
transaction boundaries.

Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d92bc83c48bdea9888e64cf1e2edbac9693099c9

Modified Files
--------------
doc/src/sgml/plpgsql.sgml                          | 20 +++++-
src/backend/executor/spi.c                         | 34 +++++----
src/backend/tcop/utility.c                         |  2 +-
src/include/executor/spi_priv.h                    |  1 +
src/include/tcop/utility.h                         |  1 +
.../plpgsql/src/expected/plpgsql_transaction.out   | 83 +++++++++++++++++-----
src/pl/plpgsql/src/pl_exec.c                       | 69 +++++++++++++-----
src/pl/plpgsql/src/pl_funcs.c                      |  4 +-
src/pl/plpgsql/src/pl_gram.y                       | 18 +++++
src/pl/plpgsql/src/pl_handler.c                    |  4 +-
src/pl/plpgsql/src/pl_scanner.c                    |  1 +
src/pl/plpgsql/src/plpgsql.h                       |  5 +-
src/pl/plpgsql/src/sql/plpgsql_transaction.sql     | 52 ++++++++++++--
13 files changed, 235 insertions(+), 59 deletions(-)



Message-ID: <E1f1Ey2-0000Yr-2e@gemulon.postgresql.org>
Permalink:  ../E1f1Ey2-0000Yr-2e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f1Ey2-0000Yr-2e@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_e@gmx.net
  Subject: Re: pgsql: PL/pgSQL: Nested CALL with transactions
  In-Reply-To: <E1f1Ey2-0000Yr-2e@gemulon.postgresql.org>
  References: <E1f1Ey2-0000Yr-2e@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