From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: PL/pgSQL: Nested CALL with transactions |
Date: | 2018-03-28 17:34:34 |
Message-ID: | E1f1Ey2-0000Yr-2e@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(dot)vondra(at)2ndquadrant(dot)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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2018-03-28 18:56:50 | Re: pgsql: Optimize btree insertions for common case of increasing values |
Previous Message | Tom Lane | 2018-03-28 17:27:22 | pgsql: Fix actual and potential double-frees around tuplesort usage. |