> I'm about 99.666667% sure that the lock type choosen in the
> FOR UPDATE case (line 511 of parse_relation.c) should be
> RowExclusiveLock instead of RowShareLock. Actually I get
> "Deadlock risk" debug messages when selecting FOR UPDATE and
> then really UPDATE.
http://www.postgresql.org/users-lounge/docs/6.5/user/x3116.htm
RowShareLock
Acquired by SELECT FOR UPDATE and LOCK TABLE for IN ROW SHARE MODE
statements.
Conflicts with ExclusiveLock and AccessExclusiveLock modes.
Vadim