Re: lock table question

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "Andy Kriger" <akriger(at)greaterthanone(dot)com>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: lock table question
Date: 2002-12-30 20:17:42
Message-ID: m3el7zl0rd.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andy Kriger" <akriger(at)greaterthanone(dot)com> writes:

> 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.

Does SELECT ... FOR UPDATE not do what you want?

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Luc Lachance 2002-12-30 20:29:47 Re: Boolean product of rows in multiple tables
Previous Message Andy Kriger 2002-12-30 19:35:28 lock table question