Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent - Mailing list pgsql-hackers

From Gregory Stark (as CFM)
Subject Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent
Date
Msg-id CAM-w4HMc95VxOhdQQiapEVM5HA0_FSss=Psr6BmyxVoTe-eBfg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers
On Thu, 9 Feb 2023 at 05:43, Aleksander Alekseev
<aleksander@timescale.com> wrote:
>
> >> I don't buy your argument about DO UPDATE needing to be brought into
> >> line with DO NOTHING. In any case I'm pretty sure that Tom's remarks
> >> in 2016 about a behavioral inconsistencies (which you cited) actually
> >> called for making DO NOTHING more like DO UPDATE -- not the other way
> >> around.
> >
> > Interesting. Yep, we could use a bit of input from Tom on this one.

I realize there are still unanswered conceptual questions about this
patch but with two votes against it seems unlikely to make much more
progress unless you rethink what you're trying to accomplish and
package it in a way that doesn't step on these more controversial
issues.

I'm going to mark the patch Returned With Feedback. If Tom or someone
else disagrees with Peter and Andres or has some new insights about
how to make it more palatable then we can always revisit that.

> > This of course would break backward compatibility. But we can always
> > invent something like:
> >
> > ```
> > INSERT INTO ..
> > ON CONFLICT DO [NOTHING|UPDATE .. ]
> > [ALLOWING|FORBIDDING] SELF CONFLICTS;
> > ```
> >
> > ... if we really want to.

Something like that might be what I mean about new insights though I
suspect this is overly complex. It looks like having the ON CONFLICT
UPDATE happen before the row is already inserted might simplify things
conceptually but then it might make the implementation prohibitively
complex.


-- 
Gregory Stark
As Commitfest Manager



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Memory leak from ExecutorState context?
Next
From: Jacob Champion
Date:
Subject: Re: allow meson to find ICU in non-standard localtion