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

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Date: 2015-08-13 22:13:46
Message-ID: 20150813221346.GH5232@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-08-13 22:29:25 pgsql: MSVC: Exclude 'brin' contrib module
Previous Message Andrew Dunstan 2015-08-13 21:42:44 Re: [COMMITTERS] pgsql: Re-add BRIN isolation test

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-08-13 22:40:43 Re: [COMMITTERS] pgsql: Re-add BRIN isolation test
Previous Message Andrew Dunstan 2015-08-13 21:42:44 Re: [COMMITTERS] pgsql: Re-add BRIN isolation test