PL/pgSQL: Nested CALL with transactions
Peter Eisentraut <peter_e@gmx.net>
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>
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/plpgsql.sgml | modified | +17 −3 |
| src/backend/executor/spi.c | modified | +22 −12 |
| src/backend/tcop/utility.c | modified | +1 −1 |
| src/include/executor/spi_priv.h | modified | +1 −0 |
| src/include/tcop/utility.h | modified | +1 −0 |
| src/pl/plpgsql/src/expected/plpgsql_transaction.out | modified | +67 −16 |
| src/pl/plpgsql/src/pl_exec.c | modified | +53 −16 |
| src/pl/plpgsql/src/pl_funcs.c | modified | +2 −2 |
| src/pl/plpgsql/src/pl_gram.y | modified | +18 −0 |
| src/pl/plpgsql/src/pl_handler.c | modified | +2 −2 |
| src/pl/plpgsql/src/plpgsql.h | modified | +4 −1 |
| src/pl/plpgsql/src/pl_scanner.c | modified | +1 −0 |
| src/pl/plpgsql/src/sql/plpgsql_transaction.sql | modified | +46 −6 |