Re: lock table question

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: lock table question
Дата
Msg-id m3el7zl0rd.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на lock table question  ("Andy Kriger" <akriger@greaterthanone.com>)
Ответы Re: lock table question  ("Andy Kriger" <akriger@greaterthanone.com>)
Список pgsql-general
"Andy Kriger" <akriger@greaterthanone.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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Andy Kriger"
Дата:
Сообщение: lock table question
Следующее
От: Artur Rataj
Дата:
Сообщение: Re: Boolean product of rows in multiple tables