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(-)