Skip to content

Commit 10f1f70

Browse files
committed
[ Previous patch reversed.]
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
1 parent 6b64704 commit 10f1f70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/regress/expected/alter_table.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ create table atacc1 ( test int );
409409
alter table atacc1 add constraint atacc_test1 check (test>3);
410410
-- should fail
411411
insert into atacc1 (test) values (2);
412-
ERROR: ExecInsert: rejected due to CHECK constraint atacc_test1
412+
ERROR: ExecInsert: rejected due to CHECK constraint "atacc_test1" on "atacc1"
413413
-- should succeed
414414
insert into atacc1 (test) values (4);
415415
drop table atacc1;
@@ -434,7 +434,7 @@ create table atacc1 ( test int, test2 int, test3 int);
434434
alter table atacc1 add constraint atacc_test1 check (test+test2<test3*4);
435435
-- should fail
436436
insert into atacc1 (test,test2,test3) values (4,4,2);
437-
ERROR: ExecInsert: rejected due to CHECK constraint atacc_test1
437+
ERROR: ExecInsert: rejected due to CHECK constraint "atacc_test1" on "atacc1"
438438
-- should succeed
439439
insert into atacc1 (test,test2,test3) values (4,4,5);
440440
drop table atacc1;
@@ -443,7 +443,7 @@ create table atacc1 (test int check (test>3), test2 int);
443443
alter table atacc1 add check (test2>test);
444444
-- should fail for $2
445445
insert into atacc1 (test2, test) values (3, 4);
446-
ERROR: ExecInsert: rejected due to CHECK constraint $1
446+
ERROR: ExecInsert: rejected due to CHECK constraint "$1" on "atacc1"
447447
drop table atacc1;
448448
-- inheritance related tests
449449
create table atacc1 (test int);
@@ -452,11 +452,11 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
452452
alter table atacc2 add constraint foo check (test2>0);
453453
-- fail and then succeed on atacc2
454454
insert into atacc2 (test2) values (-3);
455-
ERROR: ExecInsert: rejected due to CHECK constraint foo
455+
ERROR: ExecInsert: rejected due to CHECK constraint "foo" on "atacc2"
456456
insert into atacc2 (test2) values (3);
457457
-- fail and then succeed on atacc3
458458
insert into atacc3 (test2) values (-3);
459-
ERROR: ExecInsert: rejected due to CHECK constraint foo
459+
ERROR: ExecInsert: rejected due to CHECK constraint "foo" on "atacc3"
460460
insert into atacc3 (test2) values (3);
461461
drop table atacc3;
462462
drop table atacc2;
@@ -468,7 +468,7 @@ create table atacc3 (test3 int) inherits (atacc1, atacc2);
468468
alter table only atacc2 add constraint foo check (test2>0);
469469
-- fail and then succeed on atacc2
470470
insert into atacc2 (test2) values (-3);
471-
ERROR: ExecInsert: rejected due to CHECK constraint foo
471+
ERROR: ExecInsert: rejected due to CHECK constraint "foo" on "atacc2"
472472
insert into atacc2 (test2) values (3);
473473
-- both succeed on atacc3
474474
insert into atacc3 (test2) values (-3);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy