Konstantin <kostya2702@rambler.ru> writes:
> I just want to emphasize that mentioned implementation artifact born not
> obvious issues at applications side.
[ shrug... ] The "implementation artifact" is that you didn't get a
deadlock *earlier*. You can't expect to update referenced rows and
referencing rows in the same transaction and not risk deadlock against
other transactions doing the same thing.
regards, tom lane