Possible bug on update

Поиск
Список
Период
Сортировка
От Jackson, DeJuan
Тема Possible bug on update
Дата
Msg-id F10BB1FAF801D111829B0060971D839F661902@cpsmail
обсуждение исходный текст
Список pgsql-hackers
What should be the results of this little test:

drop table t1;
drop table t2;
create table t1 (a int, b int);
create table t2 (a int, c int);
insert into t1(a, b) VALUES (1, 1); 
insert into t1(a, b) VALUES (1, 2); 
insert into t1(a, b) VALUES (1, 3); 
insert into t1(a, b) VALUES (1, 4); 
insert into t1(a, b) VALUES (2, 1);   
insert into t1(a, b) VALUES (2, 2); 
insert into t1(a, b) VALUES (2, 3); 
insert into t1(a, b) VALUES (3, 1);  
insert into t1(a, b) VALUES (3, 2); 
select * from t1;
insert into t2 (a, c) select distinct a, 0 from t1;   
select * from t2;
update t2 set c = c+b from t1 where t1.a=t2.a;
select * from t2;

My guess would be:
a|c
-+--
1|10
2|6
3|3
(3 rows)
How does the standard address this?


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Angelos Karageorgiou
Дата:
Сообщение: ...
Следующее
От: "Ricardo J.C.Coelho"
Дата:
Сообщение: Multiples concatenation operator (||)