Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Andres Freund <andres(at)anarazel(dot)de>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Subject: Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
Date: 2015-04-23 20:08:34
Message-ID: 55395142.9080008@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/23/2015 10:53 PM, Andres Freund wrote:
> On 2015-04-23 12:45:59 -0700, Peter Geoghegan wrote:
>> On Thu, Apr 23, 2015 at 12:55 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>>> I think you misread my statement: I'm saying we don't need the new
>>> argument anymore, even if we still do the super-deletion in
>>> heap_delete(). Now that the speculative insertion will not be visible
>>> (as in seen on a tuple they could delete) to other backends we can just
>>> do the super deletion if we see that the tuple is a promise one.
>>
>> I disagree. I think it's appropriate that the one and only "super"
>> heap_delete() caller make a point of indicating that that's what it's
>> doing. The cost is only that the two other such callers must say that
>> they're not doing it. Super deletion is a special thing, that logical
>> decoding knows all about for example, and I think it's appropriate
>> that callers ask explicitly.
>
> Unconvinced. Not breaking an API has its worth.

The heapam API is not that stable, we've added arguments to those
functions every once in a while, and I don't recall any complaints. So
I'm with Peter that super-deletion should be requested explicitly by the
caller.

That said, I'd actually like to see a separate heap_super_delete()
function for that, rather than piggybacking on heap_delete(). It's a
quite different operation. There'll be some duplication, but seems
better than a maze of if-else's in heap_delete.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-04-23 20:14:28 Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
Previous Message Peter Geoghegan 2015-04-23 20:06:05 Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0