pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: emuser20140816@gmail.com, PostgreSQL Bugs <pgsql-bugs@lists.postgresql.org>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
Date: Sun, 25 Aug 2019 11:11:09 +0200 (CEST)
Message-ID: <alpine.DEB.2.21.1908251101540.9896@lancre> (raw)
In-Reply-To: <15977-f4eb49ebdcacc65b@postgresql.org>
References: <15977-f4eb49ebdcacc65b@postgresql.org>


> The following bug has been logged on the website:
>
> Bug reference:      15977
> Logged by:          mtlh kdvt
> Email address:      emuser20140816@gmail.com
> PostgreSQL version: 12beta3
> Operating system:   Windows
> Description:
>
> When a ROLLBACK AND CHAIN command is executed in the implicit transaction
> block, a new transaction will be started:
>   db=# ROLLBACK AND CHAIN;
>   WARNING:  there is no transaction in progress
>   ROLLBACK
>   db=# ROLLBACK AND CHAIN;
>   ROLLBACK
>
> However, a COMMIT AND CHAIN command won't start a new transaction:
>   db=# COMMIT AND CHAIN;
>   WARNING:  there is no transaction in progress
>   COMMIT
>   db=# COMMIT AND CHAIN;
>   WARNING:  there is no transaction in progress
>   COMMIT

Thanks for the report.

Indeed, I confirm, and I should have caught this one while reviewing…

Doc says:

"If AND CHAIN is specified, a new transaction is immediately started with 
the same transaction characteristics as the just finished one. Otherwise, 
no new transaction is started."

If there is no transaction in progress, the spec is undefined. Logically, 
ITSM that there should be no tx reset if none was in progress, so ROLLBACK 
has the wrong behavior?

A quick glance at the code did not yield any obvious culprit, but maybe 
I'm not looking at the right piece of code.

Doc could happend ", if any" to be clearer.

-- 
Fabien.

view thread (30+ messages)  latest in thread

Message-ID: <alpine.DEB.2.21.1908251101540.9896@lancre>
Permalink:  ../alpine.DEB.2.21.1908251101540.9896@lancre/
Also on:    postgresql.org/message-id/alpine.DEB.2.21.1908251101540.9896@lancre

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: coelho@cri.ensmp.fr, pgsql-hackers@lists.postgresql.org
  Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
  In-Reply-To: <alpine.DEB.2.21.1908251101540.9896@lancre>
  References: <15977-f4eb49ebdcacc65b@postgresql.org> <alpine.DEB.2.21.1908251101540.9896@lancre>

* 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