Update command causing lock in DB.

From: Gambhir Singh <gambhir(dot)singh05(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Update command causing lock in DB.
Date: 2025-05-07 11:15:17
Message-ID: CAHOGQfWk-xb3q0QSXY=xUsMohChEEZwjxoTzrFUK+D_GEcO+uw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

--
Thanks & Regards
Gambhir Singh

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2025-05-07 13:31:10 Re: Update command causing lock in DB.
Previous Message Stelios Malathouras 2025-05-06 06:17:17 Re: Does PostgreSQL listen_addresses='*' Dynamically Detect New Interfaces