index 085c9aba1150c0f7f31d2f7f38911bc1b32c1565..5525dd75b9f9cc010fee63fbb7f3fc4310c1b735 100644 (file)
@@ -1339,7 +1339,7 @@ DETAIL: Key (f1)=(1) is still referenced from table "defc".
-- Test the difference between NO ACTION and RESTRICT
--
create temp table pp (f1 int primary key);
-create temp table cc (f1 int references pp on update no action);
+create temp table cc (f1 int references pp on update no action on delete no action);
insert into pp values(12);
insert into pp values(11);
update pp set f1=f1+1;
update pp set f1=f1+1; -- fail
ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
DETAIL: Key (f1)=(13) is still referenced from table "cc".
+delete from pp where f1 = 13; -- fail
+ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
+DETAIL: Key (f1)=(13) is still referenced from table "cc".
drop table pp, cc;
create temp table pp (f1 int primary key);
-create temp table cc (f1 int references pp on update restrict);
+create temp table cc (f1 int references pp on update restrict on delete restrict);
insert into pp values(12);
insert into pp values(11);
update pp set f1=f1+1;
update pp set f1=f1+1; -- fail
ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
DETAIL: Key (f1)=(13) is still referenced from table "cc".
+delete from pp where f1 = 13; -- fail
+ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
+DETAIL: Key (f1)=(13) is still referenced from table "cc".
drop table pp, cc;
--
-- Test interaction of foreign-key optimization with rules (bug #14219)
index 068ab2aab7c2d0f267377f3f698ed2e636fc5bac..615588c3181ec6c147033a9141ebe6e1f8f8a460 100644 (file)
-- Test the difference between NO ACTION and RESTRICT
--
create temp table pp (f1 int primary key);
-create temp table cc (f1 int references pp on update no action);
+create temp table cc (f1 int references pp on update no action on delete no action);
insert into pp values(12);
insert into pp values(11);
update pp set f1=f1+1;
insert into cc values(13);
update pp set f1=f1+1;
update pp set f1=f1+1; -- fail
+delete from pp where f1 = 13; -- fail
drop table pp, cc;
create temp table pp (f1 int primary key);
-create temp table cc (f1 int references pp on update restrict);
+create temp table cc (f1 int references pp on update restrict on delete restrict);
insert into pp values(12);
insert into pp values(11);
update pp set f1=f1+1;
insert into cc values(13);
update pp set f1=f1+1; -- fail
+delete from pp where f1 = 13; -- fail
drop table pp, cc;
--