INSERT INTO CHECK_TBL VALUES (5);
INSERT INTO CHECK_TBL VALUES (4);
INSERT INTO CHECK_TBL VALUES (3);
-ERROR: new row for relation "check_tbl" violates CHECK constraint "check_con"
+ERROR: new row for relation "check_tbl" violates check constraint "check_con"
INSERT INTO CHECK_TBL VALUES (2);
-ERROR: new row for relation "check_tbl" violates CHECK constraint "check_con"
+ERROR: new row for relation "check_tbl" violates check constraint "check_con"
INSERT INTO CHECK_TBL VALUES (6);
INSERT INTO CHECK_TBL VALUES (1);
-ERROR: new row for relation "check_tbl" violates CHECK constraint "check_con"
+ERROR: new row for relation "check_tbl" violates 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: new row for relation "check2_tbl" violates CHECK constraint "sequence_con"
+ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con"
INSERT INTO CHECK2_TBL VALUES (5, 'z check failed', 10);
-ERROR: new row for relation "check2_tbl" violates CHECK constraint "sequence_con"
+ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con"
INSERT INTO CHECK2_TBL VALUES (0, 'check failed', -2);
-ERROR: new row for relation "check2_tbl" violates CHECK constraint "sequence_con"
+ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con"
INSERT INTO CHECK2_TBL VALUES (6, 'check failed', 11);
-ERROR: new row for relation "check2_tbl" violates CHECK constraint "sequence_con"
+ERROR: new row for relation "check2_tbl" violates 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: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates check constraint "insert_con"
SELECT '' AS zero, * FROM INSERT_TBL;
zero | x | y | z
------+---+---+---
(1 row)
INSERT INTO INSERT_TBL(y) VALUES ('Y');
-ERROR: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates check constraint "insert_con"
INSERT INTO INSERT_TBL(y) VALUES ('Y');
INSERT INTO INSERT_TBL(x,z) VALUES (1, -2);
-ERROR: new row for relation "insert_tbl" violates CHECK constraint "$1"
+ERROR: new row for relation "insert_tbl" violates check constraint "$1"
INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7);
INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5);
-ERROR: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates 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: new row for relation "insert_tbl" violates CHECK constraint "$1"
+ERROR: new row for relation "insert_tbl" violates check constraint "$1"
INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed');
-ERROR: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates 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: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates 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: new row for relation "insert_child" violates CHECK constraint "insert_child_cy"
+ERROR: new row for relation "insert_child" violates check constraint "insert_child_cy"
INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7);
-ERROR: new row for relation "insert_child" violates CHECK constraint "$1"
+ERROR: new row for relation "insert_child" violates check constraint "$1"
INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',-6,7);
-ERROR: new row for relation "insert_child" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_child" violates 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: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates 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: new row for relation "insert_tbl" violates CHECK constraint "insert_con"
+ERROR: new row for relation "insert_tbl" violates check constraint "insert_con"
SELECT * FROM INSERT_TBL;
x | y | z
---+---------------+----
(2 rows)
COPY COPY_TBL FROM '@abs_srcdir@/data/constrf.data';
-ERROR: new row for relation "copy_tbl" violates CHECK constraint "copy_con"
+ERROR: new row for relation "copy_tbl" violates check constraint "copy_con"
CONTEXT: COPY FROM, line 2
SELECT * FROM COPY_TBL;
x | y | z
INSERT INTO PRIMARY_TBL VALUES (1, 'one');
INSERT INTO PRIMARY_TBL VALUES (2, 'two');
INSERT INTO PRIMARY_TBL VALUES (1, 'three');
-ERROR: duplicate key violates UNIQUE constraint "primary_tbl_pkey"
+ERROR: duplicate key violates unique constraint "primary_tbl_pkey"
INSERT INTO PRIMARY_TBL VALUES (4, 'three');
INSERT INTO PRIMARY_TBL VALUES (5, 'one');
INSERT INTO PRIMARY_TBL (t) VALUES ('six');
-ERROR: null value for attribute "i" violates NOT NULL constraint
+ERROR: null value in column "i" violates not-null constraint
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: null value for attribute "i" violates NOT NULL constraint
+ERROR: null value in column "i" violates not-null constraint
SELECT '' AS three, * FROM PRIMARY_TBL;
three | i | t
-------+---+-------
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
-ERROR: duplicate key violates UNIQUE constraint "unique_tbl_i_key"
+ERROR: duplicate key violates unique constraint "unique_tbl_i_key"
INSERT INTO UNIQUE_TBL VALUES (4, 'four');
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
INSERT INTO UNIQUE_TBL VALUES (2, 'two');
INSERT INTO UNIQUE_TBL VALUES (1, 'three');
INSERT INTO UNIQUE_TBL VALUES (1, 'one');
-ERROR: duplicate key violates UNIQUE constraint "unique_tbl_i_key"
+ERROR: duplicate key violates unique constraint "unique_tbl_i_key"
INSERT INTO UNIQUE_TBL VALUES (5, 'one');
INSERT INTO UNIQUE_TBL (t) VALUES ('six');
SELECT '' AS five, * FROM UNIQUE_TBL;