title: Error "duplicate key value violates unique constraint" while updating multiple rows
body: <p>I created a table in PostgreSQL and Oracle as</p>
  <pre><code>CREATE TABLE temp(
     seqnr smallint NOT NULL,
     defn_id int not null,
     attr_id int not null,
     input CHAR(50) NOT NULL,
     CONSTRAINT pk_id PRIMARY KEY (defn_id, attr_id, seqnr)
  );
  </code></pre>
  <p>This temp table has primary key as (defn_id,attr_id,seqnr) as a whole!</p>
  <p>Then I inserted the record in the temp table as</p>
  <pre><code>INSERT INTO temp(seqnr,defn_id,attr_id,input)
  VALUES (1,100,100,'test1');
  
  INSERT INTO temp(seqnr,defn_id,attr_id,input)
  VALUES (2,100,100,'test2');
  
  INSERT INTO temp(seqnr,defn_id,attr_id,input)
  VALUES (3,100,100,'test3');
  
  INSERT INTO temp(seqnr,defn_id,attr_id,input)
  VALUES (4,100,100,'test4');
  
  INSERT INTO temp(seqnr,defn_id,attr_id,input)
  VALUES (5,100,100,'test5');
  </code></pre>
  <p>in both Oracle and Postgres!
  The table now contains:</p>
  <pre class="lang-none prettyprint-override"><code> seqnr |  defn_id | attr_id | input
       1 |      100 |    100  | test1
       2 |      100 |    100  | test2
       3 |      100 |    100  | test3
       4 |      100 |    100  | test4
       5 |      100 |    100  | test5
  </code></pre>
  <p>When I run the command:</p>
  <pre><code>UPDATE temp SET seqnr=seqnr+1
  WHERE defn_id = 100 AND attr_id = 100 AND seqnr &gt;= 1;
  </code></pre>
  <p>In case of ORACLE it is Updating 5 Rows and the O/p is</p>
  <pre class="lang-none prettyprint-override"><code> seqnr |  defn_id | attr_id | input
       2 |      100 |    100  | test1
       3 |      100 |    100  | test2
       4 |      100 |    100  | test3
       5 |      100 |    100  | test4
       6 |      100 |    100  | test5
  </code></pre>
  <p>But in case of PostgreSQL it is giving an error!</p>
  <blockquote>
  <pre class="lang-none prettyprint-override"><code>DETAIL:  Key (defn_id, attr_id, seqnr)=(100, 100, 2) already exists.
  </code></pre>
  </blockquote>
  <p>Why does this happen and how can I replicate the same result in Postgres as Oracle?<br />
  Or how can the same result be achieved in Postgres without any errors?</p>