Re: BUG #15977: Inconsistent behavior in chained transactions

From: fn ln <emuser20140816(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
Date: 2019-09-07 17:31:58
Message-ID: CA+99BHpwajvLbOfnFqFVrDaCP4AEg0Yn7icQ2miWe1-FFm8ndQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

No, but instead always do an implicit COMMIT after each statement, like
SELECT 1; SELECT 2; (not \;) in psql.
The PostgreSQL document even states that 'Issuing COMMIT when not inside a
transaction does no harm, but it will provoke a warning message.' for a
long time,
but in fact it have side-effect when used in an implicit transactions.
If we can ensure that the COMMIT/ROLLBACK really does nothing, we don't
have to distinguish CHAIN and NO CHAIN errors anymore.

2019年9月8日(日) 2:04 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> >> Now, I'd prefer error in all cases, no doubt about that, which might be
> >> considered a regression. A way around that could be to have a GUC decide
> >> between a strict behavior (error) and the old behavior (warning).
> >
> > I think it's more better to have a GUC to disable implicit transaction
> > 'block' feature, because that's probably the root of all issues.
>
> Hmmm… I'm not sure that erroring out on "SELECT 1" because there is no
> explicit "BEGIN" is sellable, even under some GUC.
>
> --
> Fabien.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2019-09-08 20:27:49 Re: BUG #15977: Inconsistent behavior in chained transactions
Previous Message Fabien COELHO 2019-09-07 17:04:38 Re: BUG #15977: Inconsistent behavior in chained transactions

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-09-07 18:23:20 Re: SQL-spec incompatibilities in similar_escape() and related stuff
Previous Message Fabien COELHO 2019-09-07 17:04:38 Re: BUG #15977: Inconsistent behavior in chained transactions