@@ -599,6 +599,7 @@ insert into atacc1 (test) values (4);
599
599
-- inserting NULL should fail
600
600
insert into atacc1 (test) values(NULL);
601
601
ERROR: null value in column "test" violates not-null constraint
602
+ DETAIL: Failing row contains (null).
602
603
-- try adding a second primary key (should fail)
603
604
alter table atacc1 add constraint atacc_oid1 primary key(oid);
604
605
ERROR: multiple primary keys for table "atacc1" are not allowed
@@ -664,10 +665,13 @@ ERROR: duplicate key value violates unique constraint "atacc_test1"
664
665
DETAIL: Key (test, test2)=(4, 4) already exists.
665
666
insert into atacc1 (test,test2) values (NULL,3);
666
667
ERROR: null value in column "test" violates not-null constraint
668
+ DETAIL: Failing row contains (null, 3).
667
669
insert into atacc1 (test,test2) values (3, NULL);
668
670
ERROR: null value in column "test2" violates not-null constraint
671
+ DETAIL: Failing row contains (3, null).
669
672
insert into atacc1 (test,test2) values (NULL,NULL);
670
673
ERROR: null value in column "test" violates not-null constraint
674
+ DETAIL: Failing row contains (null, null).
671
675
-- should all succeed
672
676
insert into atacc1 (test,test2) values (4,5);
673
677
insert into atacc1 (test,test2) values (5,4);
@@ -683,6 +687,7 @@ ERROR: duplicate key value violates unique constraint "atacc1_pkey"
683
687
DETAIL: Key (test)=(3) already exists.
684
688
insert into atacc1 (test2, test) values (1, NULL);
685
689
ERROR: null value in column "test" violates not-null constraint
690
+ DETAIL: Failing row contains (null, 1).
686
691
drop table atacc1;
687
692
-- alter table / alter column [set/drop] not null tests
688
693
-- try altering system catalogs, should fail
@@ -733,8 +738,10 @@ create table child (b varchar(255)) inherits (parent);
733
738
alter table parent alter a set not null;
734
739
insert into parent values (NULL);
735
740
ERROR: null value in column "a" violates not-null constraint
741
+ DETAIL: Failing row contains (null).
736
742
insert into child (a, b) values (NULL, 'foo');
737
743
ERROR: null value in column "a" violates not-null constraint
744
+ DETAIL: Failing row contains (null, foo).
738
745
alter table parent alter a drop not null;
739
746
insert into parent values (NULL);
740
747
insert into child (a, b) values (NULL, 'foo');
@@ -746,13 +753,16 @@ delete from parent;
746
753
alter table only parent alter a set not null;
747
754
insert into parent values (NULL);
748
755
ERROR: null value in column "a" violates not-null constraint
756
+ DETAIL: Failing row contains (null).
749
757
alter table child alter a set not null;
750
758
insert into child (a, b) values (NULL, 'foo');
751
759
ERROR: null value in column "a" violates not-null constraint
760
+ DETAIL: Failing row contains (null, foo).
752
761
delete from child;
753
762
alter table child alter a set not null;
754
763
insert into child (a, b) values (NULL, 'foo');
755
764
ERROR: null value in column "a" violates not-null constraint
765
+ DETAIL: Failing row contains (null, foo).
756
766
drop table child;
757
767
drop table parent;
758
768
-- test setting and removing default values
0 commit comments