diff options
Diffstat (limited to 'src/test/regress/expected/alter_table.out')
-rw-r--r-- | src/test/regress/expected/alter_table.out | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index b78e46c6f89..9cc5936fda0 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -271,10 +271,10 @@ SELECT unique1 FROM tenk1 WHERE unique1 < 5; -- FOREIGN KEY CONSTRAINT adding TEST CREATE TABLE tmp2 (a int primary key); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'tmp2_pkey' for table 'tmp2' +INFO: CREATE TABLE / PRIMARY KEY will create implicit index 'tmp2_pkey' for table 'tmp2' CREATE TABLE tmp3 (a int, b int); CREATE TABLE tmp4 (a int, b int, unique(a,b)); -NOTICE: CREATE TABLE / UNIQUE will create implicit index 'tmp4_a_key' for table 'tmp4' +INFO: CREATE TABLE / UNIQUE will create implicit index 'tmp4_a_key' for table 'tmp4' CREATE TABLE tmp5 (a int, b int); -- Insert rows into tmp2 (pktable) INSERT INTO tmp2 values (1); @@ -287,47 +287,47 @@ INSERT INTO tmp3 values (1,20); INSERT INTO tmp3 values (5,50); -- Try (and fail) to add constraint due to invalid source columns ALTER TABLE tmp3 add constraint tmpconstr foreign key(c) references tmp2 match full; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: ALTER TABLE: column "c" referenced in foreign key constraint does not exist -- Try (and fail) to add constraint due to invalide destination columns explicitly given ALTER TABLE tmp3 add constraint tmpconstr foreign key(a) references tmp2(b) match full; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: UNIQUE constraint matching given keys for referenced table "tmp2" not found -- Try (and fail) to add constraint due to invalid data ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: tmpconstr referential integrity violation - key referenced from tmp3 not found in tmp2 -- Delete failing row DELETE FROM tmp3 where a=5; -- Try (and succeed) ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) -- Try (and fail) to create constraint from tmp5(a) to tmp4(a) - unique constraint on -- tmp4 is a,b ALTER TABLE tmp5 add constraint tmpconstr foreign key(a) references tmp4(a) match full; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: UNIQUE constraint matching given keys for referenced table "tmp4" not found DROP TABLE tmp5; DROP TABLE tmp4; DROP TABLE tmp3; -NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "tmp2" -NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "tmp2" +INFO: DROP TABLE implicitly drops referential integrity trigger from table "tmp2" +INFO: DROP TABLE implicitly drops referential integrity trigger from table "tmp2" DROP TABLE tmp2; -- Foreign key adding test with mixed types -- Note: these tables are TEMP to avoid name conflicts when this test -- is run in parallel with foreign_key.sql. CREATE TEMP TABLE PKTABLE (ptest1 int PRIMARY KEY); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable' +INFO: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable' CREATE TEMP TABLE FKTABLE (ftest1 text); -- This next should fail, because text=int does not exist ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'text' and 'integer' You will have to retype this query using an explicit cast -- This should also fail for the same reason, but here we -- give the column name ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1); -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'text' and 'integer' You will have to retype this query using an explicit cast -- This should succeed, even though they are different types @@ -335,21 +335,21 @@ ERROR: Unable to identify an operator '=' for types 'text' and 'integer' DROP TABLE FKTABLE; CREATE TEMP TABLE FKTABLE (ftest1 varchar); ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) -- As should this ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1); -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) DROP TABLE pktable; -NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "fktable" -NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "fktable" +INFO: DROP TABLE implicitly drops referential integrity trigger from table "fktable" +INFO: DROP TABLE implicitly drops referential integrity trigger from table "fktable" DROP TABLE fktable; CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 text, PRIMARY KEY(ptest1, ptest2)); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable' +INFO: CREATE TABLE / PRIMARY KEY will create implicit index 'pktable_pkey' for table 'pktable' -- This should fail, because we just chose really odd types CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 datetime); ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable; -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer' You will have to retype this query using an explicit cast -- Again, so should this... @@ -357,7 +357,7 @@ DROP TABLE FKTABLE; CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 datetime); ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable(ptest1, ptest2); -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'cidr' and 'integer' You will have to retype this query using an explicit cast -- This fails because we mixed up the column ordering @@ -365,13 +365,13 @@ DROP TABLE FKTABLE; CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 text); ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable(ptest2, ptest1); -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'integer' and 'text' You will have to retype this query using an explicit cast -- As does this... ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1) references pktable(ptest1, ptest2); -NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) +INFO: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ERROR: Unable to identify an operator '=' for types 'text' and 'integer' You will have to retype this query using an explicit cast -- temp tables should go away by themselves, need not drop them. @@ -452,7 +452,7 @@ drop table atacc1; create table atacc1 ( test int ); -- add a unique constraint alter table atacc1 add constraint atacc_test1 unique (test); -NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' +INFO: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' -- insert first value insert into atacc1 (test) values (2); -- should fail @@ -462,7 +462,7 @@ ERROR: Cannot insert a duplicate key into unique index atacc_test1 insert into atacc1 (test) values (4); -- try adding a unique oid constraint alter table atacc1 add constraint atacc_oid1 unique(oid); -NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_oid1' for table 'atacc1' +INFO: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_oid1' for table 'atacc1' drop table atacc1; -- let's do one where the unique constraint fails when added create table atacc1 ( test int ); @@ -471,7 +471,7 @@ insert into atacc1 (test) values (2); insert into atacc1 (test) values (2); -- add a unique constraint (fails) alter table atacc1 add constraint atacc_test1 unique (test); -NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' +INFO: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' ERROR: Cannot create unique index. Table contains non-unique values insert into atacc1 (test) values (3); drop table atacc1; @@ -486,7 +486,7 @@ drop table atacc1; create table atacc1 ( test int, test2 int); -- add a unique constraint alter table atacc1 add constraint atacc_test1 unique (test, test2); -NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' +INFO: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc_test1' for table 'atacc1' -- insert initial value insert into atacc1 (test,test2) values (4,4); -- should fail @@ -499,9 +499,9 @@ insert into atacc1 (test,test2) values (5,5); drop table atacc1; -- lets do some naming tests create table atacc1 (test int, test2 int, unique(test)); -NOTICE: CREATE TABLE / UNIQUE will create implicit index 'atacc1_test_key' for table 'atacc1' +INFO: CREATE TABLE / UNIQUE will create implicit index 'atacc1_test_key' for table 'atacc1' alter table atacc1 add unique (test2); -NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc1_test2_key' for table 'atacc1' +INFO: ALTER TABLE / ADD UNIQUE will create implicit index 'atacc1_test2_key' for table 'atacc1' -- should fail for @@ second one @@ insert into atacc1 (test2, test) values (3, 3); insert into atacc1 (test2, test) values (2, 3); |