"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> Why can't we keep all locks until main tx end ?
For committed subtransactions we have to do that, yes, but for aborted
subtransactions we must release. Otherwise you can't implement a retry
loop around a potentially-deadlocking operation.
> (I am assuming that a deadlock will still break the whole tx)
Wrong. We might as well not bother with the entire project.
regards, tom lane