Re: Update command causing lock in DB. - Mailing list pgsql-admin

From Ron Johnson
Subject Re: Update command causing lock in DB.
Date
Msg-id CANzqJaDP=Eg_9d6aN4C8oy-na-MJhXyP7zAqLJhekBqxs75eUA@mail.gmail.com
Whole thread Raw
List pgsql-admin
On Wed, May 7, 2025 at 7:16 AM Gambhir Singh <gambhir.singh05@gmail.com> wrote:
Hi,

Application team was executing UPDATE statement in DB through Abinitio graph. When they trigger a job, a session is spawned in DB, in parallel another session is also spawned and executed the same UPDATE statement.

When I checked the locks in DB, I found that both the sessions are updating the same record. My concern is how UPDATE causes locking in DB.

Here is how MVCC works. If one session is updating a record, it should release the lock once it updated the row and other one should be able to acquire the row lock. Maybe I am wrong, please suggest how to handle this situation.
 
Do the applications use implicit autocommit, or do they use explicit transaction blocks?

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-admin by date:

Previous
From: Stelios Malathouras
Date:
Subject: Re: Does PostgreSQL listen_addresses='*' Dynamically Detect New Interfaces