lock table question - Mailing list pgsql-general

From Andy Kriger
Subject lock table question
Date
Msg-id OJEFIHHAALOBKKJEOMBDEEMMCNAA.akriger@greaterthanone.com
Whole thread Raw
List pgsql-general
I have an inventory table. I need to be able to lock a row from being
read/written while I: check the quantity value; modify it if necessary. From
my experiments, it appears I can only do this with LOCK TABLE. Since this
locks the whole table and not just the individual row, I'm guessing this
would create quite a bottleneck if our application were larger. I'm also
guessing that there's a better way to approach this probably common need.

Hoping there's a better way to do this, can anyone point me in the right
direction?

thx in advance
andy



pgsql-general by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Boolean product of rows in multiple tables
Next
From: Doug McNaught
Date:
Subject: Re: lock table question