Thread: locks and "select for update"

locks and "select for update"

From
Wayne Cuddy
Date:
The documentation about concurrency states that all the different types
of locks are table locks even if the word row appears in the lock name.

The documentation about select statements states that when "for update
of" is used that only the selected rows will be locked. Is this true or
does this really mean that when any target row is found the entire table
is locked until the end of the transaction?

Thanks,
Wayne



Re: locks and "select for update"

From
Tom Lane
Date:
Wayne Cuddy <lists-pgsql@useunix.net> writes:
> The documentation about concurrency states that all the different types
> of locks are table locks even if the word row appears in the lock name.

Section 13.3.1, "Table-level Locks", states that all the lock types
discussed therein are table-level locks, even though some of them have
names containing the word ROW for historical reasons.  I don't see how
you'd read it to imply that there are no finer-grained locks anywhere in
Postgres.
        regards, tom lane