title: Possible to upsert in Postgres on conflict on exactly one of 2 columns?
body: <p>I have a table that has two columns that are unique, and would like to upsert if the first column (or both columns) has a conflict, but do nothing if only the second column has a conflict. Is this possible?</p>
  
  <pre><code>CREATE TABLE test (
      username    VARCHAR(255) NOT NULL UNIQUE,
      email       VARCHAR(255) NOT NULL UNIQUE,
      status      VARCHAR(127)
  );
  </code></pre>
  
  <p>The following works to check for conflicts on email:</p>
  
  <pre><code>INSERT INTO test(username, email)
      VALUES ('test', 'test@test.test')
      ON CONFLICT(email) DO UPDATE SET status='upserted';
  </code></pre>
  
  <p>But I'd like to do something like this (invalid syntax below):</p>
  
  <pre><code>(INSERT INTO test(username, email)
      VALUES ('test', 'test@test.test')
      ON CONFLICT(email) DO UPDATE SET status='upserted')
      ON CONFLICT DO NOTHING;
  </code></pre>