]> granicus.if.org Git - postgresql/commit
PL/pgSQL: Nested CALL with transactions
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 24 Mar 2018 14:05:06 +0000 (10:05 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 28 Mar 2018 17:31:27 +0000 (13:31 -0400)
commitd92bc83c48bdea9888e64cf1e2edbac9693099c9
tree5cccf082581787b24af269613fb7b3cc4c4484d7
parentc2d4eb1b1fa252fd8c407e1519308017a18afed1
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>
13 files changed:
doc/src/sgml/plpgsql.sgml
src/backend/executor/spi.c
src/backend/tcop/utility.c
src/include/executor/spi_priv.h
src/include/tcop/utility.h
src/pl/plpgsql/src/expected/plpgsql_transaction.out
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/pl_gram.y
src/pl/plpgsql/src/pl_handler.c
src/pl/plpgsql/src/pl_scanner.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/sql/plpgsql_transaction.sql