title: PostgreSQL ON CONFLICT with a WHERE clause
body: <p>Postgres documentation makes it seem like a WHERE clause is possible as an ON CONFLICT condition: <a href="https://www.postgresql.org/docs/9.5/static/sql-insert.html" rel="noreferrer">https://www.postgresql.org/docs/9.5/static/sql-insert.html</a></p>
  
  <p>I have not been able to get this working (if it's possible). Here is one of the many permutations I've tried:</p>
  
  <pre><code>INSERT INTO friends (id, dob, frn, status, "groupId", 
  "createdAt", "updatedAt") 
  VALUES ('1da04305-68ef-4dc1-be6c-
  826ab83a6479', '1937-06-01T08:29:08-07:00', 100001, 'New', 'bc1567bc-
  14ff-4ba2-b108-4cb2e0f0f768', NOW(), NOW()) 
  ON CONFLICT 
      WHERE frn=100001 DO NOTHING
  </code></pre>
  
  <p>frn does not have any constraints, so the simpler syntax:</p>
  
  <pre><code>ON CONFLICT (frn) DO NOTHING
  </code></pre>
  
  <p>throws database errors. My hope is this is a simple syntax issue.</p>