Search Postgresql Archives

Another unexpected behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux