Re: Lock contention, docs vs. reality - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Lock contention, docs vs. reality
Date
Msg-id 20070422223337.S58490@megazone.bigpanda.com
Whole thread Raw
In response to Lock contention, docs vs. reality  (Roland Turner <raz.cbfgterfdy.bet@raz.cx>)
List pgsql-general
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.

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Postgresql Help
Next
From: Martijn van Oosterhout
Date:
Subject: Re: can't start tsearch2 in 8.2.4