Ramanathan <sivakrishnathan@gmail.com> writes:
> I propose modifying the use of an EXCLUSIVE lock during the backward scan
> phase, then upgrading that lock to ACCESS EXCLUSIVE only for the actual
> truncation phase. Since the truncation phase should be relatively quick,
> the impact of the ACCESS EXCLUSIVE lock should be minimal.
Except that mid-transaction lock upgrades increase the risk of
deadlock failures.
regards, tom lane