Re: INSERT ... ON CONFLICT UPDATE and logical decoding

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT UPDATE and logical decoding
Date: 2015-02-20 23:58:53
Message-ID: CAM3SWZTwHKHkic=5szTOCVRGiv3PBTvzAPW_SmgxEeK-YT+fAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 20, 2015 at 3:52 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2015-02-20 15:44:12 -0800, Peter Geoghegan wrote:
>> On Thu, Feb 19, 2015 at 2:11 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> > Yes. It'd be easiest if the only the final insert/update were actually
>> > WAL logged as full actions.
>>
>> Well, that implies that we'd actually know that we'd succeed when WAL
>> logging the speculative heap tuple's insertion.
>
> I don't think it does. It'd certainly be possible to simply only emit
> the final WAL logging action once the insertion has actually
> non-speculatively succeeded. We might decide against that for
> eefficiency or complexity reasons, but it'd be far from impossible or
> even ugly. We could even not log the actual values for the speculative
> insertion - after all, those aren't needed if we crash halfway
> through...

I think that that would be prohibitively complex and inefficient,
though. No? I will concede that it's probably possible in principle,
but that seems like a pretty academic point.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2015-02-21 00:11:19 Re: Abbreviated keys for Numeric (was: Re: B-Tree support function number 3 (strxfrm() optimization))
Previous Message Andres Freund 2015-02-20 23:52:16 Re: INSERT ... ON CONFLICT UPDATE and logical decoding