Re: Refactoring speculative insertion with unique indexes a little

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: hlinnaka <hlinnaka(at)iki(dot)fi>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Refactoring speculative insertion with unique indexes a little
Date: 2015-07-02 21:58:21
Message-ID: CAM3SWZQevhZafTa4tWy=tUkeF--0CWFDFAN+mwn5sz1ujHoDZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2015-07-02 22:05:24 WAL logging problem in 9.4.3?
Previous Message Peter Geoghegan 2015-07-02 21:54:39 Re: Time to fully remove heap_formtuple() and friends?