Re: psycopg concurrency control

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: John Lb <johnlb77(at)gmail(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: psycopg concurrency control
Date: 2016-09-11 23:47:25
Message-ID: 4029325C-9C03-4E1A-A856-9D58C5C7CBFD@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg


On Sep 11, 2016, at 8:26 AM, John Lb <johnlb77(at)gmail(dot)com> wrote:
> I am not a Postgres guy but I tried to read the documentation and I believe that Explicit Locking --> Table level Locks --> ROW EXCLUSIVE are the way to go .

You almost certainly *don't* have to do any explicit locking, even with writers to the same table; PostgreSQL will largely handle the concurrency issues for you. Note that once a particular connection has written to an (existing) row, no other session can write to that same row until the first session commits or aborts; the second session will wait for the first transaction to finish.

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message John Lb 2016-09-12 22:43:28 Re: psycopg concurrency control
Previous Message John Lb 2016-09-11 15:26:25 psycopg concurrency control