Fix behavior of AND CHAIN outside of explicit transaction blocks

Enterprise / PostgreSQL - Peter Eisentraut [eisentraut.org] - 8 September 2019 14:23 EDT

When using COMMIT AND CHAIN or ROLLBACK AND CHAIN not in an explicit transaction block, the previous implementation would leave a transaction block active in the ROLLBACK case but not the COMMIT case. To fix for now, error out when using these commands not in an explicit transaction block. This restriction could be lifted if a sensible definition and implementation is found.

Bug: #15977 Author: fn ln

862ef372d6 Fix behavior of AND CHAIN outside of explicit transaction blocks
doc/src/sgml/ref/commit.sgml | 3 +-
doc/src/sgml/ref/rollback.sgml | 3 +-
src/backend/access/transam/xact.c | 58 +++++++++++++++-------
src/test/regress/expected/transactions.out | 78 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql | 43 ++++++++++++++++
5 files changed, 166 insertions(+), 19 deletions(-)

Upstream: git.postgresql.org


  • Share