Re: MERGE and parsing with prepared statements

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Daniel Westermann <dwe(at)dbi-services(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: MERGE and parsing with prepared statements
Date: 2022-08-12 11:20:22
Message-ID: 20220812112022.k5mmzrvf5k5yeqor@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Jul-15, Justin Pryzby wrote:

> Should that sentence be removed from MERGE ?

Removed

On 2022-Jul-18, Justin Pryzby wrote:

> On Fri, Jul 15, 2022 at 03:43:41PM -0500, Justin Pryzby wrote:
> > Should that sentence be removed from MERGE ?
>
> Also, I think these examples should be more similar.

Agreed, done.

On 2022-Aug-09, Justin Pryzby wrote:

> On Tue, Aug 09, 2022 at 11:48:23AM +0200, Álvaro Herrera wrote:

> > So I propose to leave it as
> >
> > If <command>MERGE</command> attempts an <command>INSERT</command>
> > and a unique index is present and a duplicate row is concurrently
> > inserted, then a uniqueness violation error is raised;
> > <command>MERGE</command> does not attempt to avoid such
> > errors by restarting evaluation of <literal>MATCHED</literal>
> > conditions.
>
> I think by "leave it as" you mean "change it to".
> (Meaning, without referencing UPDATE).

Yes. I suppose we could add a parenthical comment, given that it's
likely the most popular option? Feel free to suggest something
specific.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"People get annoyed when you try to debug them." (Larry Wall)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2022-08-12 11:46:55 Re: MERGE and parsing with prepared statements
Previous Message Amit Kapila 2022-08-12 10:32:35 Re: Support logical replication of DDLs