title: There is no unique or exclusion constraint matching the ON CONFLICT specification
body: <p>Table <strong>copy_shop</strong>
  Column <strong>data</strong> has type  <strong>jsonb</strong></p>
  <p>If exist record with <code>data.name = myStore</code> then I need to update record. Else I need insert json.</p>
  <pre><code>{
      &quot;name&quot;: &quot;myStore&quot;,
      &quot;coords&quot;: {
          &quot;lat&quot;: &quot;47.123456&quot;,
          &quot;lon&quot;: &quot;35.7890&quot;
      }
  }
  </code></pre>
  <p>I try this:</p>
  <pre><code>INSERT INTO copy_shop (data) 
  VALUES 
  ('{
      &quot;name&quot;: &quot;myStore&quot;,
      &quot;coords&quot;: {
          &quot;lat&quot;: &quot;47.123456&quot;,
          &quot;lon&quot;: &quot;35.7890&quot;
      }
  }')
  ON CONFLICT ((data-&gt;'name')) 
  DO UPDATE SET data = copy_shop.data || '{
      &quot;name&quot;: &quot;myStore&quot;,
      &quot;coords&quot;: {
          &quot;lat&quot;: &quot;47.123456&quot;,
          &quot;lon&quot;: &quot;35.7890&quot;
      }
  }'::jsonb
  </code></pre>
  <p>But I get error:</p>
  <pre><code>ERROR:  there is no unique or exclusion constraint matching the ON CONFLICT specification
  SQL state: 42P10
  </code></pre>