PG Bug reporting form <noreply@postgresql.org> writes:
> (1) As long as the data of a single update exceeds 1 row, a deadlock will
> occur:
> update zxin_cardcapacity set usecapacity = usecapacity - 2 where a >2;
I see no particular bug here. If you want to have multiple transactions
updating the same rows concurrently, it's up to you to ensure that each
transaction touches the rows in the same order, otherwise of course there
will be a deadlock.
regards, tom lane