]> granicus.if.org Git - postgresql/commitdiff
[ Previous patch reversed.]
authorBruce Momjian <bruce@momjian.us>
Sun, 4 Aug 2002 05:11:37 +0000 (05:11 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 4 Aug 2002 05:11:37 +0000 (05:11 +0000)
Please use this patch instead of my previously submitted one.

It is just remerged against HEAD for new alter_table.out stuff.

Another reason this patch is useful for _interactive_ users: imagine a
view based on a many way join.  Imagine creating a complicated insert
rule that inserts into all the joined tables and when you insert you get
a check failure, but you need to know which actual table the constraint
was on that failed!

Christopher Kings-Lynne

src/test/regress/expected/alter_table.out

index 3833600f2b5e2319a1f40fcd92884c2b926d4e8b..b02aba52d7a63f39a9ea1b2a1aab6de66e645288 100644 (file)
@@ -409,7 +409,7 @@ create table atacc1 ( test int );
 alter table atacc1 add constraint atacc_test1 check (test>3);
 -- should fail
 insert into atacc1 (test) values (2);
-ERROR:  ExecInsert: rejected due to CHECK constraint atacc_test1
+ERROR:  ExecInsert: rejected due to CHECK constraint "atacc_test1" on "atacc1"
 -- should succeed
 insert into atacc1 (test) values (4);
 drop table atacc1;
@@ -434,7 +434,7 @@ create table atacc1 ( test int, test2 int, test3 int);
 alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
 -- should fail
 insert into atacc1 (test,test2,test3) values (4,4,2);
-ERROR:  ExecInsert: rejected due to CHECK constraint atacc_test1
+ERROR:  ExecInsert: rejected due to CHECK constraint "atacc_test1" on "atacc1"
 -- should succeed
 insert into atacc1 (test,test2,test3) values (4,4,5);
 drop table atacc1;
@@ -443,7 +443,7 @@ create table atacc1 (test int check (test>3), test2 int);
 alter table atacc1 add check (test2>test);
 -- should fail for $2
 insert into atacc1 (test2, test) values (3, 4);
-ERROR:  ExecInsert: rejected due to CHECK constraint $1
+ERROR:  ExecInsert: rejected due to CHECK constraint "$1" on "atacc1"
 drop table atacc1;
 -- inheritance related tests
 create table atacc1 (test int);
@@ -452,11 +452,11 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
 alter table atacc2 add constraint foo check (test2>0);
 -- fail and then succeed on atacc2
 insert into atacc2 (test2) values (-3);
-ERROR:  ExecInsert: rejected due to CHECK constraint foo
+ERROR:  ExecInsert: rejected due to CHECK constraint "foo" on "atacc2"
 insert into atacc2 (test2) values (3);
 -- fail and then succeed on atacc3
 insert into atacc3 (test2) values (-3);
-ERROR:  ExecInsert: rejected due to CHECK constraint foo
+ERROR:  ExecInsert: rejected due to CHECK constraint "foo" on "atacc3"
 insert into atacc3 (test2) values (3);
 drop table atacc3;
 drop table atacc2;
@@ -468,7 +468,7 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
 alter table only atacc2 add constraint foo check (test2>0);
 -- fail and then succeed on atacc2
 insert into atacc2 (test2) values (-3);
-ERROR:  ExecInsert: rejected due to CHECK constraint foo
+ERROR:  ExecInsert: rejected due to CHECK constraint "foo" on "atacc2"
 insert into atacc2 (test2) values (3);
 -- both succeed on atacc3
 insert into atacc3 (test2) values (-3);