From 561948d7d4af199b274a4e4cc7d15e14132715fc Mon Sep 17 00:00:00 2001 From: Ahmet Gedemenli Date: Wed, 20 Oct 2021 19:00:54 +0300 Subject: [PATCH] Revert&Fix citus_local_tables.sql --- .../regress/expected/citus_local_tables.out | 23 +++++++++++++++++++ .../expected/multi_master_protocol.out | 1 + src/test/regress/sql/citus_local_tables.sql | 12 ++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/test/regress/expected/citus_local_tables.out b/src/test/regress/expected/citus_local_tables.out index 709de08b4..871425744 100644 --- a/src/test/regress/expected/citus_local_tables.out +++ b/src/test/regress/expected/citus_local_tables.out @@ -416,6 +416,29 @@ SELECT create_reference_table('dummy_reference_table'); (1 row) +BEGIN; + SET client_min_messages TO ERROR; + SELECT remove_local_tables_from_metadata(); + remove_local_tables_from_metadata +--------------------------------------------------------------------- + +(1 row) + + -- should see only citus local tables that are not converted automatically + SELECT logicalrelid::regclass::text FROM pg_dist_partition, pg_tables + WHERE tablename=logicalrelid::regclass::text AND + schemaname='citus_local_tables_test_schema' AND + partmethod = 'n' AND repmodel = 's' + ORDER BY 1; + logicalrelid +--------------------------------------------------------------------- + citus_local_table_1 + citus_local_table_2 + local_table_3 + unlogged_table +(4 rows) + +ROLLBACK; -- define foreign keys between dummy_reference_table and citus local tables -- not to undistribute them automatically ALTER TABLE citus_local_table_1 ADD CONSTRAINT fkey_to_dummy_ref FOREIGN KEY (a) REFERENCES dummy_reference_table(a); diff --git a/src/test/regress/expected/multi_master_protocol.out b/src/test/regress/expected/multi_master_protocol.out index 236d73087..0053ced32 100644 --- a/src/test/regress/expected/multi_master_protocol.out +++ b/src/test/regress/expected/multi_master_protocol.out @@ -24,3 +24,4 @@ SELECT * FROM master_get_active_worker_nodes(); localhost | 57638 localhost | 57637 (2 rows) + diff --git a/src/test/regress/sql/citus_local_tables.sql b/src/test/regress/sql/citus_local_tables.sql index 2fe429cba..577393554 100644 --- a/src/test/regress/sql/citus_local_tables.sql +++ b/src/test/regress/sql/citus_local_tables.sql @@ -313,6 +313,18 @@ SET search_path TO citus_local_tables_test_schema; CREATE TABLE dummy_reference_table (a INT PRIMARY KEY); SELECT create_reference_table('dummy_reference_table'); +BEGIN; + SET client_min_messages TO ERROR; + SELECT remove_local_tables_from_metadata(); + + -- should see only citus local tables that are not converted automatically + SELECT logicalrelid::regclass::text FROM pg_dist_partition, pg_tables + WHERE tablename=logicalrelid::regclass::text AND + schemaname='citus_local_tables_test_schema' AND + partmethod = 'n' AND repmodel = 's' + ORDER BY 1; +ROLLBACK; + -- define foreign keys between dummy_reference_table and citus local tables -- not to undistribute them automatically ALTER TABLE citus_local_table_1 ADD CONSTRAINT fkey_to_dummy_ref FOREIGN KEY (a) REFERENCES dummy_reference_table(a);