Search Postgresql Archives

Re: Lock table, best option?

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

 



On Sat, Apr 24, 2010 at 2:46 PM, Andre Lopes <lopes80andre@xxxxxxxxx> 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.

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