Search Postgresql Archives

Re: Dealing with locking on batch updates.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 2, 2010 at 5:47 AM, RP Khare
<passionate_programmer@xxxxxxxxxxx> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux