mirror of https://github.com/citusdata/citus.git
Fix citus_local_tables
parent
a227bcc805
commit
bf2572a927
|
@ -949,10 +949,15 @@ select count(*) from pg_constraint where conname = 'fkey_test_drop';
|
||||||
|
|
||||||
-- verify we still preserve the child-parent hierarchy after all conversions
|
-- verify we still preserve the child-parent hierarchy after all conversions
|
||||||
-- check the shard partition
|
-- check the shard partition
|
||||||
select inhrelid::regclass from pg_inherits where (select inhparent::regclass::text) ~ '^parent_1_\d{7}$' order by 1;
|
SELECT count(*) = 1 AS child_parent_hierarchy_test
|
||||||
inhrelid
|
FROM pg_inherits
|
||||||
|
WHERE (SELECT inhparent::regclass::text) ~ '^parent_1_\d{7}$'
|
||||||
|
-- order of the child shard id is not guaranteed, but should be either 1904004 or 04
|
||||||
|
AND (inhrelid::regclass::text) IN ('parent_1_child_1_1904004', 'parent_1_child_1_1904006')
|
||||||
|
ORDER BY 1;
|
||||||
|
child_parent_hierarchy_test
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
parent_1_child_1_1904006
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- check the shell partition
|
-- check the shell partition
|
||||||
|
|
|
@ -579,10 +579,14 @@ alter table parent_1 add constraint fkey2 foreign key(a) references parent_2(a);
|
||||||
SELECT create_reference_table('ref_table');
|
SELECT create_reference_table('ref_table');
|
||||||
alter table parent_1 drop constraint fkey_test_drop;
|
alter table parent_1 drop constraint fkey_test_drop;
|
||||||
select count(*) from pg_constraint where conname = 'fkey_test_drop';
|
select count(*) from pg_constraint where conname = 'fkey_test_drop';
|
||||||
SELECT * FROM pg_dist_shard ORDER BY shardid;
|
|
||||||
-- verify we still preserve the child-parent hierarchy after all conversions
|
-- verify we still preserve the child-parent hierarchy after all conversions
|
||||||
-- check the shard partition
|
-- check the shard partition
|
||||||
select inhrelid::regclass from pg_inherits where (select inhparent::regclass::text) ~ '^parent_1_\d{7}$' order by 1;
|
SELECT count(*) = 1 AS child_parent_hierarchy_test
|
||||||
|
FROM pg_inherits
|
||||||
|
WHERE (SELECT inhparent::regclass::text) ~ '^parent_1_\d{7}$'
|
||||||
|
-- order of the child shard id is not guaranteed, but should be either 1904004 or 04
|
||||||
|
AND (inhrelid::regclass::text) IN ('parent_1_child_1_1904004', 'parent_1_child_1_1904006')
|
||||||
|
ORDER BY 1;
|
||||||
-- check the shell partition
|
-- check the shell partition
|
||||||
select inhrelid::regclass from pg_inherits where inhparent='parent_1'::regclass order by 1;
|
select inhrelid::regclass from pg_inherits where inhparent='parent_1'::regclass order by 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue