Another unexpected behaviour

Поиск
Список
Период
Сортировка
От Shianmiin
Тема Another unexpected behaviour
Дата
Msg-id 1311027523640-4610242.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: Another unexpected behaviour
Re: Another unexpected behaviour
Список 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 по дате отправления:

Предыдущее
От: Darren Duncan
Дата:
Сообщение: Re: Alarm function in PL/pgSQL
Следующее
От: MS Rao
Дата:
Сообщение: Programmer ( Postgres), Milwaukee - offsite-Remote - onsite