evgeny gridasov <eugrid(at)fpm(dot)kubsu(dot)ru> writes:
> ... and we recieve a deadlock!
> Easy to understand why: each insert statement generates query like:
> SELECT 1 FROM ONLY "public"."ref" x WHERE "id" = $1 FOR UPDATE OF x
> So, is this behaviour of postgresql is a bug or feature?
An extremely well-known bug ... which is fixed in CVS tip.
regards, tom lane