TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Postgres 15 Merge Command with Examples

145 点作者 winslett超过 2 年前

7 条评论

ryantownsend超过 2 年前
This will make complex upserts so much more simple, fantastic addition.<p>I really hope `RETURNING` support gets added to `MERGE` asap though (I believe it&#x27;s been noted as a fairly trivial addition to come in future), then it&#x27;ll be super powerful for doing bulk upserts that require post-processing.
评论 #33239499 未加载
baq超过 2 年前
&gt; prior to Postgres 15, you could use the &quot;upsert&quot; method with the ON CONFLICTclause.<p>&gt; Now, MERGE can be used instead!<p>No mention of deadlocks in the article has me worried about thoroughness of the analysis.
评论 #33239801 未加载
alexchamberlain超过 2 年前
This sounds really cool; maybe slightly cleaner than an INSERT ... ON CONFLICT statement. However, is that the only advantage?
throw03172019超过 2 年前
Great to see!<p>My biggest gripe with ON CONFLICT upserts are the IDs (sequences) having gaps in them. Any good ways to prevent that?
评论 #33241828 未加载
评论 #33240766 未加载
评论 #33242215 未加载
评论 #33244590 未加载
albertopv超过 2 年前
In SqlServer you have to use MERGE with HOLDLOCK to avoid issues, is it possible in Postgres? Is it so by default?
ramraj07超过 2 年前
This is one of my favorite features in snowflake (I’m assuming they didn’t invent it) and am happy to see it in Postgres now.
datalopers超过 2 年前
Awesome. How the hell did it take 20 years to finally land?
评论 #33239609 未加载
评论 #33264576 未加载