Search Postgresql Archives

Re: Lock contention, docs vs. reality

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

 



On Sun, 22 Apr 2007, Roland Turner wrote:

> I'm working with 7.4, but the 8.2 docs[1] have the same apparent error:
>
> ROW SHARE
>
>         Conflicts with the EXCLUSIVE and ACCESS EXCLUSIVE lock modes.
>
>         The SELECT FOR UPDATE and SELECT FOR SHARE commands acquire a
>         lock of this mode on the target table(s) (in addition to ACCESS
>         SHARE locks on any other tables that are referenced but not
>         selected FOR UPDATE/FOR SHARE).
>
> If that conflict list were correct, then ROW SHARE wouldn't conflict
> with itself, much less with ROW EXCLUSIVE (required to prevent
> INSERT/UPDATE/DELETE); commonsense dictates that it should conflict with
> both, and experiment demonstrates that it actually does so.

The list in question revolves around table-level locks. Those statements
mentioned also take out locks on affected rows. You should be able select
for update one row while updating a different row in the same table.


[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