提交 9db18178 编写于 作者: H Heikki Linnakangas

Restore upstream test query on UPDATE on a view.

It was removed years ago, presumably because GPDB didn't support updates
on views. But it seems to work fine now, so put it back.
上级 20c82fea
......@@ -418,10 +418,14 @@ select * from shipped_view;
create rule shipped_view_update as on update to shipped_view do instead
update shipped set partnum = new.partnum, value = new.value
where ttype = new.ttype and ordnum = new.ordnum;
update shipped_view set value = 11
from int4_tbl a join int4_tbl b
on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
where ordnum = a.f1;
select * from shipped_view;
ttype | ordnum | partnum | value
-------+--------+---------+---------
wt | 0 | 1 | 1234.56
ttype | ordnum | partnum | value
-------+--------+---------+-------
wt | 0 | 1 | 11
(1 row)
select f1, ss1 as relabel from
......
......@@ -418,10 +418,14 @@ select * from shipped_view;
create rule shipped_view_update as on update to shipped_view do instead
update shipped set partnum = new.partnum, value = new.value
where ttype = new.ttype and ordnum = new.ordnum;
update shipped_view set value = 11
from int4_tbl a join int4_tbl b
on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
where ordnum = a.f1;
select * from shipped_view;
ttype | ordnum | partnum | value
-------+--------+---------+---------
wt | 0 | 1 | 1234.56
ttype | ordnum | partnum | value
-------+--------+---------+-------
wt | 0 | 1 | 11
(1 row)
select f1, ss1 as relabel from
......
......@@ -241,6 +241,11 @@ create rule shipped_view_update as on update to shipped_view do instead
update shipped set partnum = new.partnum, value = new.value
where ttype = new.ttype and ordnum = new.ordnum;
update shipped_view set value = 11
from int4_tbl a join int4_tbl b
on (a.f1 = (select f1 from int4_tbl c where c.f1=b.f1))
where ordnum = a.f1;
select * from shipped_view;
select f1, ss1 as relabel from
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册