Re: Dealing with locking on batch updates.

Поиск
Список
Период
Сортировка
От Vick Khera
Тема Re: Dealing with locking on batch updates.
Дата
Msg-id AANLkTikiH6wXcYnLVPPSdCRfiFG7-Uvb_yUUT8ks4nOA@mail.gmail.com
обсуждение исходный текст
Ответ на Dealing with locking on batch updates.  (RP Khare <passionate_programmer@hotmail.com>)
Список pgsql-general
On Tue, Nov 2, 2010 at 5:47 AM, RP Khare
<passionate_programmer@hotmail.com> wrote:
> I want to know how we can handle this issue in PostgreSQL.
>

When you load your 50,000 record batch, do it inside a transaction
block and "SELECT FOR UPDATE" the rows instead of plain "SELECT".
That will lock those rows from being updated by other transactions,
which will just wait for your transaction to finish,  and conversely,
your transaction will not proceed until the other transactions have
released their update locks as well.

This is the most efficient way you can do locking.

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

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: Replication
Следующее
От: Carlos Mennens
Дата:
Сообщение: Re: 8.4 Data Not Compatible with 9.0.1 Upgrade?