Another unexpected behaviour - Mailing list pgsql-general

From Shianmiin
Subject Another unexpected behaviour
Date
Msg-id 1311027523640-4610242.post@n5.nabble.com
Whole thread Raw
Responses Re: Another unexpected behaviour  (Shianmiin <Shianmiin@gmail.com>)
Re: Another unexpected behaviour  (tomas@tuxteam.de)
List pgsql-general
setup:
====
drop table if exists t1;
create table t1 (f1 int);
create unique index uix_t1 on t1(f1) ;
insert into t1(f1) values (1), (2), (3);
select * from t1;

f1
---
1
2
3

test statement:
============
update t1 set f1 = f1 + 1;

In PostgreSQL I got,
ERROR:  duplicate key value violates unique constraint "uix_t1"
DETAIL:  Key (f1)=(2) already exists.

I tried the same test statement in both SQL Server and Oracle
I got correct/expected results as below:

select * from t1;

f1
---
2
3
4

I thought the Atomic should be at statement level, could anyone tell me why
PostgreSQL behaves differently?

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Another-unexpected-behaviour-tp4610242p4610242.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

pgsql-general by date:

Previous
From: Darren Duncan
Date:
Subject: Re: Alarm function in PL/pgSQL
Next
From: MS Rao
Date:
Subject: Programmer ( Postgres), Milwaukee - offsite-Remote - onsite