New addition to the merge sql standard - Mailing list pgsql-general

From Nick DeCoursin
Subject New addition to the merge sql standard
Date
Msg-id CAAbvdHnipKTeAZsQ0Q2ytSSxPemPFDDOaMRyO-wmxL+MBN=rpw@mail.gmail.com
Whole thread Raw
Responses Re: New addition to the merge sql standard
List pgsql-general
Dear Postgres Administrators,

There was a great article of `merge` by Lukas Fittl here: https://pganalyze.com/blog/5mins-postgres-15-merge-vs-insert-on-conflict

In his article, he highlights one of the severe disadvantages to merge:

The comment that he essentially made is that the downside of MERGE's handling of concurrency is that when you concurrently INSERT, so at the same time as you're executing the MERGE statement, there is another INSERT going on, then MERGE might not notice that. MERGE would go into its INSERT logic, and then it would get a unique violation.

This means that any individual row insert during the insert logic of the merge query can cause a unique violation and tank the entire merge query.


In my opinion, it would be better for merge to offer the functionality to simply ignore the rows that cause unique violation exceptions instead of tanking the whole query.

Thank you,
Nick

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: db size difference on primary and standby
Next
From: Alvaro Herrera
Date:
Subject: Re: New addition to the merge sql standard