Re: Transaction Isolation level for ERP software

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Mihir Kandoi <kandoimihir(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Transaction Isolation level for ERP software
Date: 2026-07-15 17:52:57
Message-ID: D103EAA7-2AC1-460D-9200-AF9C304A66DC@thebuild.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jul 15, 2026, at 10:34, Mihir Kandoi <kandoimihir(at)gmail(dot)com> wrote:
> • Is READ COMMITTED actually a better solution or should we go with retrying transactions?

There's nothing specific about ERP platforms regarding the transaction isolation mode, and READ COMMITTED isn't "better" than REPEATABLE READ or vice versa. It's a matter of what semantics you want for transactions: do you want a persistent snapshot that does not change (in from the perspective of the session with the open transaction) between statements, or can your application tolerate that?

In general, you want to use the weakest transaction isolation mode that gives you the semantics that you want. If your application is written to expect that the snapshot of the database does not change during the course of the transaction, you'll need REPEATABLE READ, and then need to come up with a solution for the serialization errors that you receive.

The source of serialization failures in REPEATABLE READ is two sessions attempting to update the same rows. That's probably the issue you should consider tracking down, since that has plenty of other potential problems (lock waits, deadlocks) apart from REPEATABLE READ.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2026-07-15 17:56:31 Re: Transaction Isolation level for ERP software
Previous Message Mihir Kandoi 2026-07-15 17:34:06 Transaction Isolation level for ERP software