@@ -1339,7 +1339,7 @@ DETAIL: Key (f1)=(1) is still referenced from table "defc".
1339
1339
-- Test the difference between NO ACTION and RESTRICT
1340
1340
--
1341
1341
create temp table pp (f1 int primary key);
1342
- create temp table cc (f1 int references pp on update no action);
1342
+ create temp table cc (f1 int references pp on update no action on delete no action );
1343
1343
insert into pp values(12);
1344
1344
insert into pp values(11);
1345
1345
update pp set f1=f1+1;
@@ -1348,16 +1348,22 @@ update pp set f1=f1+1;
1348
1348
update pp set f1=f1+1; -- fail
1349
1349
ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
1350
1350
DETAIL: Key (f1)=(13) is still referenced from table "cc".
1351
+ delete from pp where f1 = 13; -- fail
1352
+ ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
1353
+ DETAIL: Key (f1)=(13) is still referenced from table "cc".
1351
1354
drop table pp, cc;
1352
1355
create temp table pp (f1 int primary key);
1353
- create temp table cc (f1 int references pp on update restrict);
1356
+ create temp table cc (f1 int references pp on update restrict on delete restrict );
1354
1357
insert into pp values(12);
1355
1358
insert into pp values(11);
1356
1359
update pp set f1=f1+1;
1357
1360
insert into cc values(13);
1358
1361
update pp set f1=f1+1; -- fail
1359
1362
ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
1360
1363
DETAIL: Key (f1)=(13) is still referenced from table "cc".
1364
+ delete from pp where f1 = 13; -- fail
1365
+ ERROR: update or delete on table "pp" violates foreign key constraint "cc_f1_fkey" on table "cc"
1366
+ DETAIL: Key (f1)=(13) is still referenced from table "cc".
1361
1367
drop table pp, cc;
1362
1368
--
1363
1369
-- Test interaction of foreign-key optimization with rules (bug #14219)
0 commit comments