From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: tureba@gmail.com
Subject: BUG #16867: savepoints vs. commit and chain
Date: Mon, 15 Feb 2021 20:53:41 +0000
Message-ID: <16867-3475744069228158@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16867
Logged by: Arthur Nascimento
Email address: tureba@gmail.com
PostgreSQL version: 13.2
Operating system: CentOS
Description:
Hi all,
I'm seeing an unexpected behavior when using savepoints along commit and
chain. I couldn't find a mention of it in the docs and the regression tests
seem to not cover it.
On a trivial transaction, I might do:
=# begin;
*=# commit and chain;
*=# -- In this point I'm inside a second transaction
However, if the first transaction contained any unreleased savepoints, the
chain does not get me to a second transaction:
=# begin;
*=# savepoint foo;
*=# commit and chain;
=# -- In this point I'm not inside a second transaction
I first noticed it when using psql's ON_ERROR_ROLLBACK, but it can be
reproduced without it, as shown above.
I also thought it might be psql's fault at not knowing that COMMIT can also
return the state PQTRANS_INTRANS in
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/psql/common.c;h=6f507104f464fde...
But even trying a local fix (by adding COMMIT to the possible commands) to
that didn't quite solve it, so there might be something else.
Let me know what I might be missing in this.
Thanks,
Arthur Nascimento
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, tureba@gmail.com
Subject: Re: BUG #16867: savepoints vs. commit and chain
In-Reply-To: <16867-3475744069228158@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox