Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Date
Msg-id 20150813221346.GH5232@alvherre.pgsql
Whole thread Raw
List pgsql-hackers
Andres Freund wrote:
> This is implemented using a new infrastructure called "speculative
> insertion". It is an optimistic variant of regular insertion that first
> does a pre-check for existing tuples and then attempts an insert.  If a
> violating tuple was inserted concurrently, the speculatively inserted
> tuple is deleted and a new attempt is made.  If the pre-check finds a
> matching tuple the alternative DO NOTHING or DO UPDATE action is taken.
> If the insertion succeeds without detecting a conflict, the tuple is
> deemed inserted.

Is there a reason why heap_finish_speculative and heap_abort_speculative
were made to take a HeapTuple rather than just an ItemPointer?  They
only use tuple->t_self in their code (except the former, which in an
assert verifies that the tuple is indeed speculative).

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Re-add BRIN isolation test
Next
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Re-add BRIN isolation test