diff --git a/src/test/regress/expected/citus_local_tables.out b/src/test/regress/expected/citus_local_tables.out index d734ae32f..e2e972362 100644 --- a/src/test/regress/expected/citus_local_tables.out +++ b/src/test/regress/expected/citus_local_tables.out @@ -424,7 +424,7 @@ BEGIN; (1 row) - -- should not see any citus local tables + -- should see only local_table_3, since it's the only one that is converted by the user SELECT logicalrelid::regclass::text FROM pg_dist_partition, pg_tables WHERE tablename=logicalrelid::regclass::text AND schemaname='citus_local_tables_test_schema' AND @@ -432,7 +432,8 @@ BEGIN; ORDER BY 1; logicalrelid --------------------------------------------------------------------- -(0 rows) + local_table_3 +(1 row) ROLLBACK; -- define foreign keys between dummy_reference_table and citus local tables diff --git a/src/test/regress/expected/fkeys_between_local_ref.out b/src/test/regress/expected/fkeys_between_local_ref.out index 1e3f7eb20..4dd356669 100644 --- a/src/test/regress/expected/fkeys_between_local_ref.out +++ b/src/test/regress/expected/fkeys_between_local_ref.out @@ -329,49 +329,6 @@ BEGIN; -- show that we validate foreign key constraints, errors out INSERT INTO local_table_5 VALUES (300); ERROR: insert or update on table "local_table_5_1518073" violates foreign key constraint "local_table_5_col_1_fkey1_1518073" -ROLLBACK; -BEGIN; - CREATE SCHEMA another_schema_fkeys_between_local_ref; - CREATE TABLE another_schema_fkeys_between_local_ref.local_table_6 (col_1 INT PRIMARY KEY); - -- first convert local tables to citus local tables in graph - ALTER TABLE local_table_2 ADD CONSTRAINT fkey_11 FOREIGN KEY (col_1) REFERENCES reference_table_1(col_1) ON DELETE CASCADE; - CREATE TABLE local_table_5 ( - col_1 INT UNIQUE REFERENCES another_schema_fkeys_between_local_ref.local_table_6(col_1) CHECK (col_1 > 0), - col_2 INT REFERENCES local_table_3(col_1), - FOREIGN KEY (col_1) REFERENCES local_table_5(col_1)); - -- Now show that we converted local_table_5 & 6 to citus local tables - -- as local_table_5 has foreign key to a citus local table too - SELECT logicalrelid::text AS tablename, partmethod, repmodel FROM pg_dist_partition - WHERE logicalrelid::text IN (SELECT tablename FROM pg_tables WHERE schemaname='fkeys_between_local_ref' UNION - SELECT 'another_schema_fkeys_between_local_ref.local_table_6') - ORDER BY tablename; - tablename | partmethod | repmodel ---------------------------------------------------------------------- - another_schema_fkeys_between_local_ref.local_table_6 | n | s - distributed_table | h | s - local_table_1 | n | s - local_table_2 | n | s - local_table_3 | n | s - local_table_4 | n | s - local_table_5 | n | s - reference_table_1 | n | t -(8 rows) - - DROP TABLE local_table_3 CASCADE; - DROP SCHEMA another_schema_fkeys_between_local_ref CASCADE; - -- now we shouldn't see local_table_5 since now it is not connected to any reference tables - SELECT logicalrelid::text AS tablename, partmethod, repmodel FROM pg_dist_partition - WHERE logicalrelid::text IN (SELECT tablename FROM pg_tables WHERE schemaname='fkeys_between_local_ref') - ORDER BY tablename; - tablename | partmethod | repmodel ---------------------------------------------------------------------- - distributed_table | h | s - local_table_1 | n | s - local_table_2 | n | s - local_table_4 | n | s - reference_table_1 | n | t -(5 rows) - ROLLBACK; BEGIN; CREATE TABLE local_table_6 (col_1 INT PRIMARY KEY); diff --git a/src/test/regress/expected/multi_metadata_sync.out b/src/test/regress/expected/multi_metadata_sync.out index 7a5b75e11..2e7d42a50 100644 --- a/src/test/regress/expected/multi_metadata_sync.out +++ b/src/test/regress/expected/multi_metadata_sync.out @@ -19,7 +19,7 @@ COMMENT ON FUNCTION master_metadata_snapshot() IS 'commands to create the metadata snapshot'; -- Show that none of the existing tables are qualified to be MX tables SELECT * FROM pg_dist_partition WHERE partmethod='h' AND repmodel='s'; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- (0 rows) @@ -273,9 +273,9 @@ SELECT * FROM pg_dist_node ORDER BY nodeid; (4 rows) SELECT * FROM pg_dist_partition ORDER BY logicalrelid; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- - mx_testing_schema.mx_test_table | h | {VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location -1} | 0 | s + mx_testing_schema.mx_test_table | h | {VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location -1} | 0 | s | f (1 row) SELECT * FROM pg_dist_shard ORDER BY shardid; @@ -410,9 +410,9 @@ SELECT * FROM pg_dist_node ORDER BY nodeid; (4 rows) SELECT * FROM pg_dist_partition ORDER BY logicalrelid; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- - mx_testing_schema.mx_test_table | h | {VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location -1} | 0 | s + mx_testing_schema.mx_test_table | h | {VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 1 :location -1} | 0 | s | f (1 row) SELECT * FROM pg_dist_shard ORDER BY shardid; @@ -731,7 +731,7 @@ ORDER BY \d mx_test_schema_1.mx_table_1 \d mx_test_schema_2.mx_table_2 SELECT * FROM pg_dist_partition; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- (0 rows) diff --git a/src/test/regress/expected/multi_table_ddl.out b/src/test/regress/expected/multi_table_ddl.out index f1d23a06d..4c991dfcb 100644 --- a/src/test/regress/expected/multi_table_ddl.out +++ b/src/test/regress/expected/multi_table_ddl.out @@ -60,7 +60,7 @@ DROP TABLE testtableddl; RESET citus.shard_replication_factor; -- ensure no metadata of distributed tables are remaining SELECT * FROM pg_dist_partition; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- (0 rows) diff --git a/src/test/regress/expected/single_node.out b/src/test/regress/expected/single_node.out index 2d709ac86..4e0e9f98a 100644 --- a/src/test/regress/expected/single_node.out +++ b/src/test/regress/expected/single_node.out @@ -1248,7 +1248,7 @@ NOTICE: renaming the new table to single_node.test_2 (1 row) SELECT * FROM pg_dist_partition WHERE logicalrelid = 'test_2'::regclass; - logicalrelid | partmethod | partkey | colocationid | repmodel + logicalrelid | partmethod | partkey | colocationid | repmodel | autoconverted --------------------------------------------------------------------- (0 rows) diff --git a/src/test/regress/sql/fkeys_between_local_ref.sql b/src/test/regress/sql/fkeys_between_local_ref.sql index 0cdeb706a..56881a2ab 100644 --- a/src/test/regress/sql/fkeys_between_local_ref.sql +++ b/src/test/regress/sql/fkeys_between_local_ref.sql @@ -245,34 +245,6 @@ BEGIN; INSERT INTO local_table_5 VALUES (300); ROLLBACK; -BEGIN; - CREATE SCHEMA another_schema_fkeys_between_local_ref; - CREATE TABLE another_schema_fkeys_between_local_ref.local_table_6 (col_1 INT PRIMARY KEY); - - -- first convert local tables to citus local tables in graph - ALTER TABLE local_table_2 ADD CONSTRAINT fkey_11 FOREIGN KEY (col_1) REFERENCES reference_table_1(col_1) ON DELETE CASCADE; - - CREATE TABLE local_table_5 ( - col_1 INT UNIQUE REFERENCES another_schema_fkeys_between_local_ref.local_table_6(col_1) CHECK (col_1 > 0), - col_2 INT REFERENCES local_table_3(col_1), - FOREIGN KEY (col_1) REFERENCES local_table_5(col_1)); - - -- Now show that we converted local_table_5 & 6 to citus local tables - -- as local_table_5 has foreign key to a citus local table too - SELECT logicalrelid::text AS tablename, partmethod, repmodel FROM pg_dist_partition - WHERE logicalrelid::text IN (SELECT tablename FROM pg_tables WHERE schemaname='fkeys_between_local_ref' UNION - SELECT 'another_schema_fkeys_between_local_ref.local_table_6') - ORDER BY tablename; - - DROP TABLE local_table_3 CASCADE; - DROP SCHEMA another_schema_fkeys_between_local_ref CASCADE; - - -- now we shouldn't see local_table_5 since now it is not connected to any reference tables - SELECT logicalrelid::text AS tablename, partmethod, repmodel FROM pg_dist_partition - WHERE logicalrelid::text IN (SELECT tablename FROM pg_tables WHERE schemaname='fkeys_between_local_ref') - ORDER BY tablename; -ROLLBACK; - BEGIN; CREATE TABLE local_table_6 (col_1 INT PRIMARY KEY); -- first convert local tables to citus local tables in graph