diff --git a/src/test/regress/expected/citus_local_tables.out b/src/test/regress/expected/citus_local_tables.out index 4f3053094..08784f789 100644 --- a/src/test/regress/expected/citus_local_tables.out +++ b/src/test/regress/expected/citus_local_tables.out @@ -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 -- check the shard partition -select inhrelid::regclass from pg_inherits where (select inhparent::regclass::text) ~ '^parent_1_\d{7}$' order by 1; - inhrelid +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; + child_parent_hierarchy_test --------------------------------------------------------------------- - parent_1_child_1_1904006 + t (1 row) -- check the shell partition diff --git a/src/test/regress/sql/citus_local_tables.sql b/src/test/regress/sql/citus_local_tables.sql index ace8c22c9..f61c97f9d 100644 --- a/src/test/regress/sql/citus_local_tables.sql +++ b/src/test/regress/sql/citus_local_tables.sql @@ -579,10 +579,14 @@ alter table parent_1 add constraint fkey2 foreign key(a) references parent_2(a); SELECT create_reference_table('ref_table'); alter table parent_1 drop constraint 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 -- 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 select inhrelid::regclass from pg_inherits where inhparent='parent_1'::regclass order by 1;