On Thu, Jul 2, 2015 at 10:49 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> Well, waiting means getting a ShareLock on the other session's XID.
> You can't do that without first releasing your locks, unless you're
> okay with unprincipled deadlocks.
Besides, if the other session wins the race and inserts a physical
heap tuple, but then aborts its xact, we might have to insert again
(although not before super-deleting), with that insert going on to be
successful.
As with row locking, with insertion, if there is a conflict, any
outcome (UPDATE or INSERT) is then possible.
--
Peter Geoghegan