<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>maximInstantcoffee</author_name>
  <author_url>https://blog.hatena.ne.jp/maximInstantcoffee/</author_url>
  <blog_title>maximInstantcoffeeの日記</blog_title>
  <blog_url>https://maximinstantcoffee.hatenadiary.com/</blog_url>
  <categories>
  </categories>
  <description>ある条件に当てはまるデータが登録済みならupdate、なければinsertをしたい。 結論からいうとONCONFLICTを使えばよいです。 ONCONFLICT ONCONFLICTが使えるのはPostgresql 9.5以上、 ONCONFLICTに指定する項目はUNIQUE制約である必要があります。 INSERT INTO test_table( id , point , time ) VALUES ( '1' , 100 , '2020/08/20 10:00:00.000' ) ON CONFLICT(id) DO UPDATE SET point = 100; CTE ONCONFL…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmaximinstantcoffee.hatenadiary.com%2Fentry%2F2020%2F10%2F19%2F115131&quot; title=&quot;postgresqlでupdate insert - maximInstantcoffeeの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-10-19 11:51:31</published>
  <title>postgresqlでupdate insert</title>
  <type>rich</type>
  <url>https://maximinstantcoffee.hatenadiary.com/entry/2020/10/19/115131</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
