diff options
| author | Michael P | 2011-12-20 05:53:30 +0000 |
|---|---|---|
| committer | Michael P | 2011-12-20 06:01:03 +0000 |
| commit | f47b660ce3b37fe71de5ec486e57c578282e3280 (patch) | |
| tree | 8f3db96d71db8691f71982ab3e1a3be479217206 /src/test | |
| parent | f255e931ffb3ece1b06264463401da8e2d8b3b99 (diff) | |
Support for DEFAULT with non-shippable expressions
In case default values are related to non-shippable expressions,
their values are now evaluated on Coordinator and then sent down
to Datanodes with values already calculated.
Regarding sequences, now sequences are created on all the nodes
to maintain consistency among default expressions created among
the cluster. Their values are exclusively generated at Coordinator
level though so value unicity is insured whatever the table type
and its node list on which table data is distributed.
This is particularly useful for tables using sequence-related
functions this way:
CREATE TABLE example (col int default nextval('seq'));
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/dependency_1.out | 2 | ||||
| -rw-r--r-- | src/test/regress/expected/domain_1.out | 7 | ||||
| -rw-r--r-- | src/test/regress/expected/uuid_1.out | 153 | ||||
| -rw-r--r-- | src/test/regress/output/constraints_1.source | 218 |
4 files changed, 166 insertions, 214 deletions
diff --git a/src/test/regress/expected/dependency_1.out b/src/test/regress/expected/dependency_1.out index 827f442672..eeb2a1c110 100644 --- a/src/test/regress/expected/dependency_1.out +++ b/src/test/regress/expected/dependency_1.out @@ -102,8 +102,6 @@ CREATE TABLE deptest2 (f1 int); -- make a serial column the hard way CREATE SEQUENCE ss1; ALTER TABLE deptest2 ALTER f1 SET DEFAULT nextval('ss1'); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported ALTER SEQUENCE ss1 OWNED BY deptest2.f1; RESET SESSION AUTHORIZATION; REASSIGN OWNED BY regression_user1 TO regression_user2; diff --git a/src/test/regress/expected/domain_1.out b/src/test/regress/expected/domain_1.out index f2f45379d6..e3a6127396 100644 --- a/src/test/regress/expected/domain_1.out +++ b/src/test/regress/expected/domain_1.out @@ -246,8 +246,6 @@ create domain ddef2 oid DEFAULT '12'; create domain ddef3 text DEFAULT 5; create sequence ddef4_seq; create domain ddef4 int4 DEFAULT nextval('ddef4_seq'); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported create domain ddef5 numeric(8,2) NOT NULL DEFAULT '12.12'; create table defaulttest ( col1 ddef1 @@ -259,9 +257,7 @@ create table defaulttest , col7 ddef4 DEFAULT 8000 , col8 ddef5 ); -ERROR: type "ddef4" does not exist -LINE 5: , col4 ddef4 PRIMARY KEY - ^ +ERROR: Column col4 is not a hash distributable data type insert into defaulttest(col4) values(0); -- fails, col5 defaults to null ERROR: relation "defaulttest" does not exist LINE 1: insert into defaulttest(col4) values(0); @@ -410,7 +406,6 @@ drop domain ddef1 restrict; drop domain ddef2 restrict; drop domain ddef3 restrict; drop domain ddef4 restrict; -ERROR: type "ddef4" does not exist drop domain ddef5 restrict; drop sequence ddef4_seq; -- Test domains over domains diff --git a/src/test/regress/expected/uuid_1.out b/src/test/regress/expected/uuid_1.out index 39ea1e952d..982f1dd7b2 100644 --- a/src/test/regress/expected/uuid_1.out +++ b/src/test/regress/expected/uuid_1.out @@ -5,147 +5,144 @@ CREATE TABLE guid1 guid_field UUID, text_field TEXT DEFAULT(now()) ); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported CREATE TABLE guid2 ( guid_field UUID, text_field TEXT DEFAULT(now()) ); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported -- inserting invalid data tests -- too long INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111F'); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "11111111-1111-1111-1111-111111111111F" LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-111... - ^ + ^ -- too short INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-1111-11111111111}'); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "{11111111-1111-1111-1111-11111111111}" LINE 1: INSERT INTO guid1(guid_field) VALUES('{11111111-1111-1111-11... - ^ + ^ -- valid data but invalid format INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-1111-111111111111'); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "111-11111-1111-1111-1111-111111111111" LINE 1: INSERT INTO guid1(guid_field) VALUES('111-11111-1111-1111-11... - ^ + ^ INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222 '); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "{22222222-2222-2222-2222-222222222222 " LINE 1: INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-22... - ^ + ^ -- invalid data INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G111-111111111111'); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "11111111-1111-1111-G111-111111111111" LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-G11... - ^ + ^ INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-1111-111111111111'); -ERROR: relation "guid1" does not exist +ERROR: invalid input syntax for uuid: "11+11111-1111-1111-1111-111111111111" LINE 1: INSERT INTO guid1(guid_field) VALUES('11+11111-1111-1111-111... - ^ + ^ --inserting three input formats INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111'); -ERROR: relation "guid1" does not exist -LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-111... - ^ INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}'); -ERROR: relation "guid1" does not exist -LINE 1: INSERT INTO guid1(guid_field) VALUES('{22222222-2222-2222-22... - ^ INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e'); -ERROR: relation "guid1" does not exist -LINE 1: INSERT INTO guid1(guid_field) VALUES('3f3e3c3b3a303938373635... - ^ -- retrieving the inserted data SELECT guid_field FROM guid1 ORDER BY guid_field; -ERROR: relation "guid1" does not exist -LINE 1: SELECT guid_field FROM guid1 ORDER BY guid_field; - ^ + guid_field +-------------------------------------- + 11111111-1111-1111-1111-111111111111 + 22222222-2222-2222-2222-222222222222 + 3f3e3c3b-3a30-3938-3736-353433a2313e +(3 rows) + -- ordering test SELECT guid_field FROM guid1 ORDER BY guid_field ASC; -ERROR: relation "guid1" does not exist -LINE 1: SELECT guid_field FROM guid1 ORDER BY guid_field ASC; - ^ + guid_field +-------------------------------------- + 11111111-1111-1111-1111-111111111111 + 22222222-2222-2222-2222-222222222222 + 3f3e3c3b-3a30-3938-3736-353433a2313e +(3 rows) + SELECT guid_field FROM guid1 ORDER BY guid_field DESC; -ERROR: relation "guid1" does not exist -LINE 1: SELECT guid_field FROM guid1 ORDER BY guid_field DESC; - ^ + guid_field +-------------------------------------- + 3f3e3c3b-3a30-3938-3736-353433a2313e + 22222222-2222-2222-2222-222222222222 + 11111111-1111-1111-1111-111111111111 +(3 rows) + -- = operator test SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30-3938-3736-353433a2313e'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field = '3f3e3c3b-3a30... - ^ + count +------- + 1 +(1 row) + -- <> operator test SELECT COUNT(*) FROM guid1 WHERE guid_field <> '11111111111111111111111111111111'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field <> '111111111111... - ^ + count +------- + 2 +(1 row) + -- < operator test SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222-2222-2222-222222222222'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field < '22222222-2222... - ^ + count +------- + 1 +(1 row) + -- <= operator test SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-2222-2222-2222-222222222222'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field <= '22222222-222... - ^ + count +------- + 2 +(1 row) + -- > operator test SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222-2222-2222-222222222222'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field > '22222222-2222... - ^ + count +------- + 1 +(1 row) + -- >= operator test SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-222222222222'; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-222... - ^ + count +------- + 2 +(1 row) + -- btree and hash index creation test CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field); -ERROR: relation "guid1" does not exist CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field); -ERROR: relation "guid1" does not exist -- unique index test CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field); -ERROR: relation "guid1" does not exist +ERROR: Unique index of partitioned table must contain the hash/modulo distribution column. -- should fail INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-1111-111111111111'); -ERROR: relation "guid1" does not exist -LINE 1: INSERT INTO guid1(guid_field) VALUES('11111111-1111-1111-111... - ^ -- check to see whether the new indexes are actually there SELECT count(*) FROM pg_class WHERE relkind='i' AND relname LIKE 'guid%'; count ------- - 0 + 2 (1 row) -- populating the test tables with additional records INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-4444-444444444444'); -ERROR: relation "guid1" does not exist -LINE 1: INSERT INTO guid1(guid_field) VALUES('44444444-4444-4444-444... - ^ INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-1111-111111111111'); -ERROR: relation "guid2" does not exist -LINE 1: INSERT INTO guid2(guid_field) VALUES('11111111-1111-1111-111... - ^ INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-2222-222222222222}'); -ERROR: relation "guid2" does not exist -LINE 1: INSERT INTO guid2(guid_field) VALUES('{22222222-2222-2222-22... - ^ INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a3039383736353433a2313e'); -ERROR: relation "guid2" does not exist -LINE 1: INSERT INTO guid2(guid_field) VALUES('3f3e3c3b3a303938373635... - ^ -- join test SELECT COUNT(*) FROM guid1 g1 INNER JOIN guid2 g2 ON g1.guid_field = g2.guid_field; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 g1 INNER JOIN guid2 g2 ON g1.guid... - ^ + count +------- + 4 +(1 row) + SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_field = g2.guid_field WHERE g2.guid_field IS NULL; -ERROR: relation "guid1" does not exist -LINE 1: SELECT COUNT(*) FROM guid1 g1 LEFT JOIN guid2 g2 ON g1.guid_... - ^ + count +------- + 1 +(1 row) + -- clean up DROP TABLE guid1, guid2 CASCADE; -ERROR: table "guid1" does not exist diff --git a/src/test/regress/output/constraints_1.source b/src/test/regress/output/constraints_1.source index bd04188535..e6af9d80f5 100644 --- a/src/test/regress/output/constraints_1.source +++ b/src/test/regress/output/constraints_1.source @@ -30,28 +30,19 @@ SELECT '' AS five, * FROM DEFAULT_TBL ORDER BY i,x,f; CREATE SEQUENCE DEFAULT_SEQ; CREATE TABLE DEFAULTEXPR_TBL (i1 int DEFAULT 100 + (200-199) * 2, i2 int DEFAULT nextval('default_seq')); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported INSERT INTO DEFAULTEXPR_TBL VALUES (-1, -2); -ERROR: relation "defaultexpr_tbl" does not exist -LINE 1: INSERT INTO DEFAULTEXPR_TBL VALUES (-1, -2); - ^ INSERT INTO DEFAULTEXPR_TBL (i1) VALUES (-3); -ERROR: relation "defaultexpr_tbl" does not exist -LINE 1: INSERT INTO DEFAULTEXPR_TBL (i1) VALUES (-3); - ^ INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (-4); -ERROR: relation "defaultexpr_tbl" does not exist -LINE 1: INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (-4); - ^ INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (NULL); -ERROR: relation "defaultexpr_tbl" does not exist -LINE 1: INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (NULL); - ^ SELECT '' AS four, * FROM DEFAULTEXPR_TBL ORDER BY i1,i2; -ERROR: relation "defaultexpr_tbl" does not exist -LINE 1: SELECT '' AS four, * FROM DEFAULTEXPR_TBL ORDER BY i1,i2; - ^ + four | i1 | i2 +------+-----+---- + | -3 | 1 + | -1 | -2 + | 102 | -4 + | 102 | +(4 rows) + -- syntax errors -- test for extraneous comma CREATE TABLE error_tbl (i int DEFAULT (100, )); @@ -120,16 +111,13 @@ CREATE TABLE INSERT_TBL (x INT DEFAULT nextval('insert_seq'), z INT DEFAULT -1 * currval('insert_seq'), CONSTRAINT INSERT_CON CHECK (x >= 3 AND y <> 'check failed' AND x < 8), CHECK (x + z = 0)); -ERROR: Postgres-XC does not support DEFAULT with non-immutable functions yet -DETAIL: The feature is not currently supported INSERT INTO INSERT_TBL(x,z) VALUES (2, -2); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(x,z) VALUES (2, -2); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" SELECT '' AS zero, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS zero, * FROM INSERT_TBL order by x,y,z; - ^ + zero | x | y | z +------+---+---+--- +(0 rows) + SELECT 'one' AS one, nextval('insert_seq'); one | nextval -----+--------- @@ -137,173 +125,147 @@ SELECT 'one' AS one, nextval('insert_seq'); (1 row) INSERT INTO INSERT_TBL(y) VALUES ('Y'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) VALUES ('Y'); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" INSERT INTO INSERT_TBL(y) VALUES ('Y'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) VALUES ('Y'); - ^ INSERT INTO INSERT_TBL(x,z) VALUES (1, -2); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(x,z) VALUES (1, -2); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_tbl_check" INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7); - ^ INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" INSERT INTO INSERT_TBL VALUES (7, '!check failed', -7); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL VALUES (7, '!check failed', -7); - ^ INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); - ^ SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; - ^ + four | x | y | z +------+---+---------------+---- + | 3 | Y | -3 + | 4 | -!NULL- | -4 + | 7 | !check failed | -7 + | 7 | -NULL- | -7 +(4 rows) + INSERT INTO INSERT_TBL(y,z) VALUES ('check failed', 4); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y,z) VALUES ('check failed', 4); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_tbl_check" INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed'); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" INSERT INTO INSERT_TBL(x,y) VALUES (5, '!check failed'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(x,y) VALUES (5, '!check failed'); - ^ INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); - ^ SELECT '' AS six, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS six, * FROM INSERT_TBL order by x,y,z; - ^ + six | x | y | z +-----+---+---------------+---- + | 3 | Y | -3 + | 4 | -!NULL- | -4 + | 5 | !check failed | -5 + | 6 | -!NULL- | -6 + | 7 | !check failed | -7 + | 7 | -NULL- | -7 +(6 rows) + SELECT 'seven' AS one, nextval('insert_seq'); one | nextval -------+--------- - seven | 2 + seven | 7 (1 row) INSERT INTO INSERT_TBL(y) VALUES ('Y'); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) VALUES ('Y'); - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" SELECT 'eight' AS one, currval('insert_seq'); one | currval -------+--------- - eight | 2 + eight | 8 (1 row) -- According to SQL92, it is OK to insert a record that gives rise to NULL -- constraint-condition results. Postgres used to reject this, but it -- was wrong: INSERT INTO INSERT_TBL VALUES (null, null, null); -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL VALUES (null, null, null); - ^ SELECT '' AS nine, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS nine, * FROM INSERT_TBL order by x,y,z; - ^ + nine | x | y | z +------+---+---------------+---- + | 3 | Y | -3 + | 4 | -!NULL- | -4 + | 5 | !check failed | -5 + | 6 | -!NULL- | -6 + | 7 | !check failed | -7 + | 7 | -NULL- | -7 + | | | +(7 rows) + -- -- Check inheritance of defaults and constraints -- CREATE TABLE INSERT_CHILD (cx INT default 42, cy INT CHECK (cy > x)) INHERITS (INSERT_TBL); -ERROR: relation "insert_tbl" does not exist INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,11); -ERROR: relation "insert_child" does not exist -LINE 1: INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,11); - ^ INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,6); -ERROR: relation "insert_child" does not exist -LINE 1: INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,6); - ^ +ERROR: new row for relation "insert_child" violates check constraint "insert_child_check" INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7); -ERROR: relation "insert_child" does not exist -LINE 1: INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7); - ^ +ERROR: new row for relation "insert_child" violates check constraint "insert_tbl_check" INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',-6,7); -ERROR: relation "insert_child" does not exist -LINE 1: INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',... - ^ +ERROR: new row for relation "insert_child" violates check constraint "insert_con" SELECT * FROM INSERT_CHILD order by 1,2,3; -ERROR: relation "insert_child" does not exist -LINE 1: SELECT * FROM INSERT_CHILD order by 1,2,3; - ^ + x | y | z | cx | cy +---+--------+----+----+---- + 7 | -NULL- | -7 | 42 | 11 +(1 row) + DROP TABLE INSERT_CHILD; -ERROR: table "insert_child" does not exist -- -- Check constraints on INSERT INTO -- DELETE FROM INSERT_TBL; -ERROR: relation "insert_tbl" does not exist -LINE 1: DELETE FROM INSERT_TBL; - ^ ALTER SEQUENCE INSERT_SEQ RESTART WITH 4; CREATE TABLE tmp (xd INT, yd TEXT, zd INT); INSERT INTO tmp VALUES (null, 'Y', null); INSERT INTO tmp VALUES (5, '!check failed', null); INSERT INTO tmp VALUES (null, 'try again', null); INSERT INTO INSERT_TBL(y) select yd from tmp; -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y) select yd from tmp; - ^ SELECT '' AS three, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS three, * FROM INSERT_TBL order by x,y,z; - ^ + three | x | y | z +-------+---+---------------+---- + | 4 | Y | -4 + | 5 | !check failed | -5 + | 6 | try again | -6 +(3 rows) + INSERT INTO INSERT_TBL SELECT * FROM tmp WHERE yd = 'try again'; -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL SELECT * FROM tmp WHERE yd = 'try aga... - ^ INSERT INTO INSERT_TBL(y,z) SELECT yd, -7 FROM tmp WHERE yd = 'try again'; -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y,z) SELECT yd, -7 FROM tmp WHERE yd ... - ^ INSERT INTO INSERT_TBL(y,z) SELECT yd, -8 FROM tmp WHERE yd = 'try again'; -ERROR: relation "insert_tbl" does not exist -LINE 1: INSERT INTO INSERT_TBL(y,z) SELECT yd, -8 FROM tmp WHERE yd ... - ^ +ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; - ^ + four | x | y | z +------+---+---------------+---- + | 4 | Y | -4 + | 5 | !check failed | -5 + | 6 | try again | -6 + | 7 | try again | -7 + | | try again | + | | try again | +(6 rows) + DROP TABLE tmp; -- -- Check constraints on UPDATE -- UPDATE INSERT_TBL SET x = NULL WHERE x = 5; -ERROR: relation "insert_tbl" does not exist -LINE 1: UPDATE INSERT_TBL SET x = NULL WHERE x = 5; - ^ +ERROR: Partition column can't be updated in current version UPDATE INSERT_TBL SET x = 6 WHERE x = 6; -ERROR: relation "insert_tbl" does not exist -LINE 1: UPDATE INSERT_TBL SET x = 6 WHERE x = 6; - ^ +ERROR: Partition column can't be updated in current version UPDATE INSERT_TBL SET x = -z, z = -x; -ERROR: relation "insert_tbl" does not exist -LINE 1: UPDATE INSERT_TBL SET x = -z, z = -x; - ^ +ERROR: Partition column can't be updated in current version UPDATE INSERT_TBL SET x = z, z = x; -ERROR: relation "insert_tbl" does not exist -LINE 1: UPDATE INSERT_TBL SET x = z, z = x; - ^ +ERROR: Partition column can't be updated in current version SELECT * FROM INSERT_TBL order by x,y,z; -ERROR: relation "insert_tbl" does not exist -LINE 1: SELECT * FROM INSERT_TBL order by x,y,z; - ^ + x | y | z +---+---------------+---- + 4 | Y | -4 + 5 | !check failed | -5 + 6 | try again | -6 + 7 | try again | -7 + | try again | + | try again | +(6 rows) + -- DROP TABLE INSERT_TBL; -- -- Check constraints on COPY FROM |
