Alvaro Herrera <alvherre@commandprompt.com> writes:
> This only happens because of the unique index. There's no predicate
> locking involved. The btree code goes some lengths to make this work;
That's one way to look at it; the other is to say that we have predicate
locking for a very specific class of predicate, ie, equality of a
unique key.
In practice I think we only have a useful lock there for *primary* keys,
because unique without NOT NULL doesn't actually constrain you to just
one matching row ...
regards, tom lane