1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Fix behavior of AND CHAIN outside of explicit transaction blocks

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 <emuser20140816@gmail.com>
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
This commit is contained in:
Peter Eisentraut
2019-09-08 16:11:21 +02:00
parent 0e77746212
commit 862ef372d6
5 changed files with 166 additions and 19 deletions

View File

@ -77,7 +77,8 @@ COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
<para>
Issuing <command>COMMIT</command> when not inside a transaction does
no harm, but it will provoke a warning message.
no harm, but it will provoke a warning message. <command>COMMIT AND
CHAIN</command> when not inside a transaction is an error.
</para>
</refsect1>

View File

@ -76,7 +76,8 @@ ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
<para>
Issuing <command>ROLLBACK</command> outside of a transaction
block emits a warning and otherwise has no effect.
block emits a warning and otherwise has no effect. <command>ROLLBACK AND
CHAIN</command> outside of a transaction block is an error.
</para>
</refsect1>