alter table atacc1 add constraint atacc_test1 check (test+test2
-- should fail
insert into atacc1 (test,test2,test3) values (4,4,2);
-ERROR: ExecAppend: rejected due to CHECK constraint atacc_test1
+ERROR: ExecInsert: rejected due to CHECK constraint atacc_test1
-- should succeed
insert into atacc1 (test,test2,test3) values (4,4,5);
drop table atacc1;
alter table atacc1 add check (test2>test);
-- should fail for $2
insert into atacc1 (test2, test) values (3, 4);
-ERROR: ExecAppend: rejected due to CHECK constraint $2
+ERROR: ExecInsert: rejected due to CHECK constraint $2
drop table atacc1;
-- inheritance related tests
create table atacc1 (test int);
alter table atacc2 add constraint foo check (test2>0);
-- fail and then succeed on atacc2
insert into atacc2 (test2) values (-3);
-ERROR: ExecAppend: rejected due to CHECK constraint foo
+ERROR: ExecInsert: rejected due to CHECK constraint foo
insert into atacc2 (test2) values (3);
-- fail and then succeed on atacc3
insert into atacc3 (test2) values (-3);
-ERROR: ExecAppend: rejected due to CHECK constraint foo
+ERROR: ExecInsert: rejected due to CHECK constraint foo
insert into atacc3 (test2) values (3);
drop table atacc3;
drop table atacc2;
alter table only atacc2 add constraint foo check (test2>0);
-- fail and then succeed on atacc2
insert into atacc2 (test2) values (-3);
-ERROR: ExecAppend: rejected due to CHECK constraint foo
+ERROR: ExecInsert: rejected due to CHECK constraint foo
insert into atacc2 (test2) values (3);
-- both succeed on atacc3
insert into atacc3 (test2) values (-3);
insert into atacc1 (test2, test) values (2, 3);
ERROR: Cannot insert a duplicate key into unique index atacc1_pkey
insert into atacc1 (test2, test) values (1, NULL);
-ERROR: ExecAppend: Fail to add null value in not null attribute test
+ERROR: ExecInsert: Fail to add null value in not null attribute test
drop table atacc1;
-- alter table / alter column [set/drop] not null tests
-- try altering system catalogs, should fail
create table child (b varchar(255)) inherits (parent);
alter table parent alter a set not null;
insert into parent values (NULL);
-ERROR: ExecAppend: Fail to add null value in not null attribute a
+ERROR: ExecInsert: Fail to add null value in not null attribute a
insert into child (a, b) values (NULL, 'foo');
-ERROR: ExecAppend: Fail to add null value in not null attribute a
+ERROR: ExecInsert: Fail to add null value in not null attribute a
alter table parent alter a drop not null;
insert into parent values (NULL);
insert into child (a, b) values (NULL, 'foo');
delete from parent;
alter table only parent alter a set not null;
insert into parent values (NULL);
-ERROR: ExecAppend: Fail to add null value in not null attribute a
+ERROR: ExecInsert: Fail to add null value in not null attribute a
alter table child alter a set not null;
insert into child (a, b) values (NULL, 'foo');
-ERROR: ExecAppend: Fail to add null value in not null attribute a
+ERROR: ExecInsert: Fail to add null value in not null attribute a
delete from child;
alter table child alter a set not null;
insert into child (a, b) values (NULL, 'foo');
-ERROR: ExecAppend: Fail to add null value in not null attribute a
+ERROR: ExecInsert: Fail to add null value in not null attribute a
drop table child;
drop table parent;
-- test setting and removing default values
INSERT INTO CHECK_TBL VALUES (5);
INSERT INTO CHECK_TBL VALUES (4);
INSERT INTO CHECK_TBL VALUES (3);
-ERROR: ExecAppend: rejected due to CHECK constraint check_con
+ERROR: ExecInsert: rejected due to CHECK constraint check_con
INSERT INTO CHECK_TBL VALUES (2);
-ERROR: ExecAppend: rejected due to CHECK constraint check_con
+ERROR: ExecInsert: rejected due to CHECK constraint check_con
INSERT INTO CHECK_TBL VALUES (6);
INSERT INTO CHECK_TBL VALUES (1);
-ERROR: ExecAppend: rejected due to CHECK constraint check_con
+ERROR: ExecInsert: rejected due to CHECK constraint check_con
SELECT '' AS three, * FROM CHECK_TBL;
three | x
-------+---
CHECK (x > 3 and y <> 'check failed' and z < 8));
INSERT INTO CHECK2_TBL VALUES (4, 'check ok', -2);
INSERT INTO CHECK2_TBL VALUES (1, 'x check failed', -2);
-ERROR: ExecAppend: rejected due to CHECK constraint sequence_con
+ERROR: ExecInsert: rejected due to CHECK constraint sequence_con
INSERT INTO CHECK2_TBL VALUES (5, 'z check failed', 10);
-ERROR: ExecAppend: rejected due to CHECK constraint sequence_con
+ERROR: ExecInsert: rejected due to CHECK constraint sequence_con
INSERT INTO CHECK2_TBL VALUES (0, 'check failed', -2);
-ERROR: ExecAppend: rejected due to CHECK constraint sequence_con
+ERROR: ExecInsert: rejected due to CHECK constraint sequence_con
INSERT INTO CHECK2_TBL VALUES (6, 'check failed', 11);
-ERROR: ExecAppend: rejected due to CHECK constraint sequence_con
+ERROR: ExecInsert: rejected due to CHECK constraint sequence_con
INSERT INTO CHECK2_TBL VALUES (7, 'check ok', 7);
SELECT '' AS two, * from CHECK2_TBL;
two | x | y | z
CONSTRAINT INSERT_CON CHECK (x >= 3 AND y <> 'check failed' AND x < 8),
CHECK (x + z = 0));
INSERT INTO INSERT_TBL(x,z) VALUES (2, -2);
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
SELECT '' AS zero, * FROM INSERT_TBL;
zero | x | y | z
------+---+---+---
(1 row)
INSERT INTO INSERT_TBL(y) VALUES ('Y');
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
INSERT INTO INSERT_TBL(y) VALUES ('Y');
INSERT INTO INSERT_TBL(x,z) VALUES (1, -2);
-ERROR: ExecAppend: rejected due to CHECK constraint $2
+ERROR: ExecInsert: rejected due to CHECK constraint $2
INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7);
INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5);
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
INSERT INTO INSERT_TBL VALUES (7, '!check failed', -7);
INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-');
SELECT '' AS four, * FROM INSERT_TBL;
(4 rows)
INSERT INTO INSERT_TBL(y,z) VALUES ('check failed', 4);
-ERROR: ExecAppend: rejected due to CHECK constraint $2
+ERROR: ExecInsert: rejected due to CHECK constraint $2
INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed');
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
INSERT INTO INSERT_TBL(x,y) VALUES (5, '!check failed');
INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-');
SELECT '' AS six, * FROM INSERT_TBL;
(1 row)
INSERT INTO INSERT_TBL(y) VALUES ('Y');
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
SELECT 'eight' AS one, currval('insert_seq');
one | currval
-------+---------
INHERITS (INSERT_TBL);
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,11);
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,6);
-ERROR: ExecAppend: rejected due to CHECK constraint insert_child_cy
+ERROR: ExecInsert: rejected due to CHECK constraint insert_child_cy
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7);
-ERROR: ExecAppend: rejected due to CHECK constraint $1
+ERROR: ExecInsert: rejected due to CHECK constraint $1
INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',-6,7);
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
SELECT * FROM INSERT_CHILD;
x | y | z | cx | cy
---+--------+----+----+----
INSERT INTO INSERT_TBL SELECT * FROM tmp WHERE yd = 'try again';
INSERT INTO INSERT_TBL(y,z) SELECT yd, -7 FROM tmp WHERE yd = 'try again';
INSERT INTO INSERT_TBL(y,z) SELECT yd, -8 FROM tmp WHERE yd = 'try again';
-ERROR: ExecAppend: rejected due to CHECK constraint insert_con
+ERROR: ExecInsert: rejected due to CHECK constraint insert_con
SELECT '' AS four, * FROM INSERT_TBL;
four | x | y | z
------+---+---------------+----
UPDATE INSERT_TBL SET x = 6 WHERE x = 6;
UPDATE INSERT_TBL SET x = -z, z = -x;
UPDATE INSERT_TBL SET x = z, z = x;
-ERROR: ExecReplace: rejected due to CHECK constraint insert_con
+ERROR: ExecUpdate: rejected due to CHECK constraint insert_con
SELECT * FROM INSERT_TBL;
x | y | z
---+---------------+----
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
-ERROR: ExecAppend: Fail to add null value in not null attribute i
+ERROR: ExecInsert: Fail to add null value in not null attribute i
SELECT '' AS four, * FROM PRIMARY_TBL;
four | i | t
------+---+-------
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
-ERROR: ExecAppend: Fail to add null value in not null attribute i
+ERROR: ExecInsert: Fail to add null value in not null attribute i
SELECT '' AS three, * FROM PRIMARY_TBL;
three | i | t
-------+---+-------