Re: Documentation should state what happens, when a commit fails - Mailing list pgsql-docs

From Dave Cramer
Subject Re: Documentation should state what happens, when a commit fails
Date
Msg-id CADK3HH+b3dWpMGvSUUArLO62hHAGY+qaF1kCDBaK0KbC-yAJ7Q@mail.gmail.com
Whole thread Raw
In response to Re: Documentation should state what happens, when a commit fails  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Documentation should state what happens, when a commit fails
List pgsql-docs



On Wed, 28 May 2025 at 10:59, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, May 28, 2025 at 7:47 AM mark maker <mark@makr.zone> wrote:

Wow, great improvement, thanks!

The "tutorial-transactions" opens a new question that might be useful to know: when a transaction enters the aborted state at an early point in time (as has now become clear), does this mean it will also relinquish any locks and predicate locks early, or will it still hold onto those until explicitly rolled back by command?


I suppose if the system knows there are no savepoints in progress it could release the locks and whatnot...not sure if it knows that and acts upon that knowledge if it does.  Easy enough to test with two psql sessions if you want to give it a go before I or someone else gets around to it.

Somewhat annoying feature of this behaviour is that when COMMIT is issued on an aborted transaction no error is reported.
Most drivers work around this problem by keeping track of the previous error and reporting an error on the COMMIT.
Dave

pgsql-docs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Documentation should state what happens, when a commit fails
Next
From: Laurenz Albe
Date:
Subject: Re: Documentation should state what happens, when a commit fails