mirror of https://github.com/citusdata/citus.git
Revert&Fix citus_local_tables.sql
parent
ecd8dd2465
commit
561948d7d4
|
|
@ -416,6 +416,29 @@ SELECT create_reference_table('dummy_reference_table');
|
||||||
|
|
||||||
(1 row)
|
(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
|
-- define foreign keys between dummy_reference_table and citus local tables
|
||||||
-- not to undistribute them automatically
|
-- 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);
|
ALTER TABLE citus_local_table_1 ADD CONSTRAINT fkey_to_dummy_ref FOREIGN KEY (a) REFERENCES dummy_reference_table(a);
|
||||||
|
|
|
||||||
|
|
@ -24,3 +24,4 @@ SELECT * FROM master_get_active_worker_nodes();
|
||||||
localhost | 57638
|
localhost | 57638
|
||||||
localhost | 57637
|
localhost | 57637
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -313,6 +313,18 @@ SET search_path TO citus_local_tables_test_schema;
|
||||||
CREATE TABLE dummy_reference_table (a INT PRIMARY KEY);
|
CREATE TABLE dummy_reference_table (a INT PRIMARY KEY);
|
||||||
SELECT create_reference_table('dummy_reference_table');
|
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
|
-- define foreign keys between dummy_reference_table and citus local tables
|
||||||
-- not to undistribute them automatically
|
-- 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);
|
ALTER TABLE citus_local_table_1 ADD CONSTRAINT fkey_to_dummy_ref FOREIGN KEY (a) REFERENCES dummy_reference_table(a);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue