Re: Lock table, best option?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Lock table, best option?
Дата
Msg-id m2gdcc563d11004260019w71e03034pe15cd6d238be914a@mail.gmail.com
обсуждение исходный текст
Ответ на Lock table, best option?  (Andre Lopes <lopes80andre@gmail.com>)
Список pgsql-general
On Sat, Apr 24, 2010 at 2:46 PM, Andre Lopes <lopes80andre@gmail.com> wrote:
> Hi,
>
> I need to do a SELECT and an UPDATE, but I will have concurrent processes
> doing the same task.

If you're selecting and updating the same rows, then select ... for
update is preferred and adequate.  If you're selecting one set of rows
and updating another set / another table, then you may have to lock
the tables concerned.

> How can I prevent that the concurrent task don't have the same results in
> the SELECT? Locking a table? How can I do that?

Lock table locks a table.  But if select ... for update will work then
that is preferred.

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

Предыдущее
От: "Nikhil G. Daddikar"
Дата:
Сообщение: Postgresql on EC2/EBS in production?
Следующее
От: Yan Cheng CHEOK
Дата:
Сообщение: Re: Deadlock occur while creating new table to be used in partition.