title: Postgres read commited doesn't re read updated row
body: <p>Good day. I was playing with <code>READ COMMITTED</code> isolation level in postgres and found strange behavior which doesn't follow official documentation.
  Let's say I have a table <code>account(id int,name text,amount int)</code> and two rows. </p>
  
  <pre><code>test&gt; select * from account;                       
  -[ RECORD 1 ]-------------------------
  id     | 1
  name   | Bob
  amount | 800
  -[ RECORD 2 ]-------------------------
  id     | 2
  name   | Bob
  amount | 200
  
  </code></pre>
  
  <p>Now I start two READ COMMITTED transactions . First one executes the following query </p>
  
  <pre><code>UPDATE account set amount = 100 where id = 2; -- 1
  </code></pre>
  
  <p>And then second one executes this query</p>
  
  <pre><code> UPDATE account set amount = amount+50 --2
    where name in 
        (select DISTINCT name from account group by
        name having sum(amount)&gt;=1000); 
  </code></pre>
  
  <p>Now it is locked because first transaction is not committed yet. So the second transaction wants to add 50 to each account whose total amount is bigger or equals to 1000. As Bob has two accounts (800+200) then it should add 50 to each account. However , now first transaction was committed <code>COMMIT; --1</code> and now Bob has 900 at total and according to <a href="https://www.postgresql.org/docs/9.5/transaction-iso.html" rel="nofollow noreferrer">Documentation</a> Read committed transaction will </p>
  
  <blockquote>
    <p>The search condition of the command (the WHERE clause) is
    re-evaluated to see if the updated version of the row still matches
    the search condition. If so, the second updater proceeds with its
    operation using the updated version of the row</p>
  </blockquote>
  
  <p>As far as I understand , second transaction will <strong>re-evaluate</strong> where condition and skip Bob's accounts. However when second transaction was committed the final rows look like this </p>
  
  <pre><code>id     | 1                                                                                            │
  name   | Bob                                                                                          │
  amount | 850                                                                                          │
  -[ RECORD 3 ]-------------------------                                                                │
  id     | 2                                                                                            │
  name   | Bob                                                                                          │
  amount | 150 
  </code></pre>
  
  <p>which means that the second transaction didn't re-evaluate search condition and applied update to rows even if they are not matched by condition. Why does it happen . Did I miss something in the documentation ? </p>