@ -2368,26 +2368,26 @@ DETAIL: Failing row contains (-1, invalid).
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
-- check that an auto-updatable view on a partitioned table works correctly
-- check that an auto-updatable view on a partitioned table works correctly
create table p (a int, b int) partition by range (a, b);
create table pt (a int, b int) partition by range (a, b);
create table p1 (b int not null, a int not null) partition by range (b);
create table pt 1 (b int not null, a int not null) partition by range (b);
create table p11 (like p1);
create table pt 11 (like pt 1);
alter table p11 drop a;
alter table pt 11 drop a;
alter table p11 add a int;
alter table pt 11 add a int;
alter table p11 drop a;
alter table pt 11 drop a;
alter table p11 add a int not null;
alter table pt 11 add a int not null;
alter table p1 attach partition p11 for values from (2) to (5);
alter table pt 1 attach partition pt 11 for values from (2) to (5);
alter table p attach partition p1 for values from (1, 2) to (1, 10);
alter table pt attach partition pt 1 for values from (1, 2) to (1, 10);
create view pv as select * from p;
create view pt v as select * from pt ;
insert into pv values (1, 2);
insert into pt v values (1, 2);
select tableoid::regclass, * from p;
select tableoid::regclass, * from pt ;
tableoid | a | b
tableoid | a | b
----------+---+---
----------+---+---
p11 | 1 | 2
pt 11 | 1 | 2
(1 row)
(1 row)
create view pv_wco as select * from p where a = 0 with check option;
create view pt v_wco as select * from pt where a = 0 with check option;
insert into pv_wco values (1, 2);
insert into pt v_wco values (1, 2);
ERROR: new row violates check option for view "pv_wco"
ERROR: new row violates check option for view "pt v_wco"
DETAIL: Failing row contains (2, 1).
DETAIL: Failing row contains (2, 1).
drop view pv, pv_wco;
drop view pt v, pt v_wco;
drop table p, p1, p11;
drop table pt , pt 1, pt 11;