Search Postgresql Archives

New addition to the merge sql standard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

I explained this in more detail here: https://stackoverflow.com/questions/77479975/postgres-merge-silently-ignore-unique-constraint-violation

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux