title: Postgresql INSERT ... ON CONFLICT ... WHERE not triggering
body: <p>I have a table like this:</p>
  
  <pre><code>CREATE TABLE import_files (
      id          SERIAL PRIMARY KEY,
      file        TEXT NOT NULL,
      volume      TEXT NOT NULL,
      lastimport  DATE DEFAULT CURRENT_DATE,
      UNIQUE (file,volume)
  )
  </code></pre>
  
  <p>I am trying to import data into the table, such that if a combination of <code>file</code>
  and <code>volume</code> does not already exist in the table, a new row should be added,
  otherwise if there is an existing row, that row should be updated so that
  <code>lastimport</code> is today's date.</p>
  
  <p>However I do not want to do any update if that row is already todays date (the
  same rows may be presented many times a day).</p>
  
  <p>I am trying to use Postgresql 9.6's new <code>ON CONFLICT</code> clause for this, as follows:</p>
  
  <pre><code>INSERT INTO import_files(file,volume) 
  VALUES('MyFile1', 'VolA')
  ON CONFLICT (file,volume) DO
      UPDATE SET lastimport = CURRENT_DATE
  WHERE EXCLUDED.lastimport &lt; CURRENT_DATE
  RETURNING id
  </code></pre>
  
  <p>but it does not seem to be working for me. Initial import works fine, but for the
  update case it does not seem to update even where the WHERE clause is true:</p>
  
  <pre><code>t1=&gt; select * from import_files;
   id |  file   | volume | lastimport
  ----+---------+--------+------------
    1 | MyFile1 | VolA   | 2017-05-07
  (1 row)
  
  t1=&gt;     INSERT INTO import_files(file,volume)
      VALUES('MyFile1', 'VolA')
      ON CONFLICT (file,volume) DO
          UPDATE SET lastimport = CURRENT_DATE
      WHERE EXCLUDED.lastimport &lt; CURRENT_DATE
      RETURNING id
  ;
   id
  ----
  (0 rows)
  
  INSERT 0 0
  </code></pre>
  
  <p>Since today is 2017-05-08 I would have expected that row to be updated.</p>
  
  <p>Have I misunderstood the purpose or usage of the WHERE clause in this context?</p>