diff --git a/src/test/regress/expected/drop_partitioned_table.out b/src/test/regress/expected/drop_partitioned_table.out index 846656aaf..9eee8a7cf 100644 --- a/src/test/regress/expected/drop_partitioned_table.out +++ b/src/test/regress/expected/drop_partitioned_table.out @@ -368,6 +368,8 @@ NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.pa NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.parent_xxxxx CASCADE NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') +NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046) +NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046) ROLLBACK; NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK @@ -389,6 +391,8 @@ NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.parent_xxxxx CASCAD NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing SELECT worker_drop_distributed_table('drop_partitioned_table.child1') NOTICE: issuing DROP TABLE IF EXISTS drop_partitioned_table.child1_xxxxx CASCADE +NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046) +NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(100046) ROLLBACK; NOTICE: issuing ROLLBACK NOTICE: issuing ROLLBACK diff --git a/src/test/regress/expected/function_propagation.out b/src/test/regress/expected/function_propagation.out index 1ec5736f5..9070649b7 100644 --- a/src/test/regress/expected/function_propagation.out +++ b/src/test/regress/expected/function_propagation.out @@ -1119,7 +1119,7 @@ SELECT create_distributed_function('func_to_colocate(int)', colocate_with:='tbl_ SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; distribution_argument_index | colocationid | force_delegation --------------------------------------------------------------------- - | 10003 | + | 161 | (1 row) -- convert to non-delegated @@ -1147,7 +1147,7 @@ SELECT create_distributed_function('func_to_colocate(int)','$1','tbl_to_colocate SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; distribution_argument_index | colocationid | force_delegation --------------------------------------------------------------------- - 0 | 10005 | + 0 | 162 | (1 row) -- try create or replace the same func @@ -1156,7 +1156,7 @@ CREATE OR REPLACE FUNCTION func_to_colocate (a int) returns int as $$select 1;$$ SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; distribution_argument_index | colocationid | force_delegation --------------------------------------------------------------------- - 0 | 10005 | + 0 | 162 | (1 row) -- convert to non-delegated @@ -1184,7 +1184,7 @@ SELECT create_distributed_function('func_to_colocate(int)','$1','tbl_to_colocate SELECT distribution_argument_index, colocationid, force_delegation FROM pg_catalog.pg_dist_object WHERE objid = 'func_to_colocate'::regproc; distribution_argument_index | colocationid | force_delegation --------------------------------------------------------------------- - 0 | 10005 | t + 0 | 162 | t (1 row) -- convert to non-delegated diff --git a/src/test/regress/expected/multi_colocation_utils.out b/src/test/regress/expected/multi_colocation_utils.out index 1fa58264c..bf91256f9 100644 --- a/src/test/regress/expected/multi_colocation_utils.out +++ b/src/test/regress/expected/multi_colocation_utils.out @@ -451,7 +451,8 @@ SELECT * FROM pg_dist_colocation 5 | 2 | 1 | 23 | 0 6 | 2 | 2 | 25 | 100 7 | 8 | 2 | 23 | 0 -(4 rows) + 21 | 1 | -1 | 0 | 0 +(5 rows) -- check to see whether metadata is synced SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ @@ -464,11 +465,13 @@ $$); 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57637 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 1, "colocationid": 21, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 8, "colocationid": 7, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} -(8 rows) + 57638 | {"shardcount": 1, "colocationid": 21, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} +(10 rows) SELECT logicalrelid, colocationid FROM pg_dist_partition WHERE colocationid >= 1 AND colocationid < 1000 @@ -508,18 +511,15 @@ DROP TABLE table2_groupA; SELECT * FROM pg_dist_colocation WHERE colocationid = 4; colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation --------------------------------------------------------------------- - 4 | 2 | 2 | 23 | 0 -(1 row) +(0 rows) -- check to see whether metadata is synced SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ -SELECT array_agg(row_to_json(c)) FROM pg_dist_colocation c WHERE colocationid = 4 +SELECT coalesce(array_agg(row_to_json(c)), '{}') FROM pg_dist_colocation c WHERE colocationid = 4 $$); - nodeport | unnest + nodeport | unnest --------------------------------------------------------------------- - 57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} - 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} -(2 rows) +(0 rows) -- create dropped colocation group again SET citus.shard_count = 2; @@ -606,33 +606,36 @@ SELECT * FROM pg_dist_colocation ORDER BY colocationid; colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation --------------------------------------------------------------------- - 4 | 2 | 2 | 23 | 0 5 | 2 | 1 | 23 | 0 6 | 2 | 2 | 25 | 100 7 | 8 | 2 | 23 | 0 + 8 | 2 | 2 | 23 | 0 + 9 | 2 | 2 | 23 | 0 + 10 | 2 | 2 | 23 | 0 11 | 3 | 2 | 23 | 0 -(5 rows) + 21 | 1 | -1 | 0 | 0 +(8 rows) SELECT logicalrelid, colocationid FROM pg_dist_partition WHERE colocationid >= 1 AND colocationid < 1000 ORDER BY colocationid, logicalrelid; logicalrelid | colocationid --------------------------------------------------------------------- - table1_groupe | 4 - table2_groupe | 4 - table3_groupe | 4 - schema_colocation.table4_groupe | 4 - table4_groupe | 4 table1_groupb | 5 table2_groupb | 5 table1_groupc | 6 table2_groupc | 6 table1_groupd | 7 table2_groupd | 7 - table1_group_none_1 | 8 - table2_group_none_1 | 8 - table1_group_none_2 | 9 - table1_group_none_3 | 10 + table1_groupe | 8 + table2_groupe | 8 + table3_groupe | 8 + schema_colocation.table4_groupe | 8 + table4_groupe | 8 + table1_group_none_1 | 9 + table2_group_none_1 | 9 + table1_group_none_2 | 10 + table1_group_none_3 | 11 table1_group_default | 11 (16 rows) @@ -699,12 +702,15 @@ SELECT * FROM pg_dist_colocation ORDER BY colocationid; colocationid | shardcount | replicationfactor | distributioncolumntype | distributioncolumncollation --------------------------------------------------------------------- - 4 | 2 | 2 | 23 | 0 5 | 2 | 1 | 23 | 0 6 | 2 | 2 | 25 | 100 7 | 8 | 2 | 23 | 0 + 8 | 2 | 2 | 23 | 0 + 9 | 2 | 2 | 23 | 0 + 10 | 2 | 2 | 23 | 0 11 | 3 | 2 | 23 | 0 -(5 rows) + 21 | 1 | -1 | 0 | 0 +(8 rows) -- cross check with internal colocation API SELECT @@ -739,8 +745,9 @@ ORDER BY table3_groupe | table4_groupe | t schema_colocation.table4_groupe | table4_groupe | t table1_group_none_1 | table2_group_none_1 | t + table1_group_none_3 | table1_group_default | t table1_groupf | table2_groupf | t -(16 rows) +(17 rows) -- check created shards SELECT @@ -979,7 +986,10 @@ SELECT * FROM pg_dist_colocation 3 | 8 | 2 | 23 | 0 4 | 2 | 2 | 23 | 0 5 | 2 | 2 | 23 | 0 -(5 rows) + 6 | 2 | 2 | 23 | 0 + 7 | 1 | -1 | 0 | 0 + 8 | 2 | 2 | 23 | 0 +(8 rows) -- check to see whether metadata is synced SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ @@ -993,12 +1003,18 @@ $$); 57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} -(10 rows) + 57638 | {"shardcount": 2, "colocationid": 6, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} + 57638 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} + 57638 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} +(16 rows) SELECT logicalrelid, colocationid FROM pg_dist_partition WHERE colocationid >= 1 AND colocationid < 1000 @@ -1015,7 +1031,7 @@ SELECT logicalrelid, colocationid FROM pg_dist_partition table1_groupe | 5 table3_groupe | 5 table1_group_none | 6 - table2_group_none | 7 + table2_group_none | 8 (11 rows) -- move the all tables in colocation group 5 to colocation group 7 @@ -1073,7 +1089,9 @@ SELECT * FROM pg_dist_colocation 3 | 8 | 2 | 23 | 0 4 | 2 | 2 | 23 | 0 5 | 2 | 2 | 23 | 0 -(5 rows) + 7 | 1 | -1 | 0 | 0 + 8 | 2 | 2 | 23 | 0 +(7 rows) -- check to see whether metadata is synced SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ @@ -1087,12 +1105,16 @@ $$); 57637 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57637 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} + 57637 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 1, "replicationfactor": 1, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 2, "replicationfactor": 2, "distributioncolumntype": "25", "distributioncolumncollation": "100"} 57638 | {"shardcount": 8, "colocationid": 3, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 4, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} 57638 | {"shardcount": 2, "colocationid": 5, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} -(10 rows) + 57638 | {"shardcount": 1, "colocationid": 7, "replicationfactor": -1, "distributioncolumntype": "0", "distributioncolumncollation": "0"} + 57638 | {"shardcount": 2, "colocationid": 8, "replicationfactor": 2, "distributioncolumntype": "23", "distributioncolumncollation": "0"} +(14 rows) SELECT logicalrelid, colocationid FROM pg_dist_partition WHERE colocationid >= 1 AND colocationid < 1000 @@ -1108,8 +1130,8 @@ SELECT logicalrelid, colocationid FROM pg_dist_partition table2_groupe | 4 table1_groupe | 5 table3_groupe | 5 - table1_group_none | 7 - table2_group_none | 7 + table1_group_none | 8 + table2_group_none | 8 (11 rows) -- try to colocate different replication models diff --git a/src/test/regress/expected/multi_fix_partition_shard_index_names.out b/src/test/regress/expected/multi_fix_partition_shard_index_names.out index 91a65dc02..e398b5fd2 100644 --- a/src/test/regress/expected/multi_fix_partition_shard_index_names.out +++ b/src/test/regress/expected/multi_fix_partition_shard_index_names.out @@ -678,9 +678,9 @@ NOTICE: issuing SET citus.enable_ddl_propagation TO 'off' DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx NOTICE: issuing SET citus.enable_ddl_propagation TO 'off' DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 1370000, 's') +NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 100050, 's') DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 1370000, 's') +NOTICE: issuing SELECT citus_internal_add_partition_metadata ('fix_idx_names.p2'::regclass, 'h', 'dist_col', 100050, 's') DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx NOTICE: issuing WITH shard_data(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) AS (VALUES ('fix_idx_names.p2'::regclass, 915002, 't'::"char", '-2147483648', '2147483647')) SELECT citus_internal_add_shard_metadata(relationname, shardid, storagetype, shardminvalue, shardmaxvalue) FROM shard_data; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx diff --git a/src/test/regress/expected/multi_metadata_sync.out b/src/test/regress/expected/multi_metadata_sync.out index 749254292..cd2adc2f6 100644 --- a/src/test/regress/expected/multi_metadata_sync.out +++ b/src/test/regress/expected/multi_metadata_sync.out @@ -1895,12 +1895,12 @@ SELECT unnest(activate_node_snapshot()) order by 1; RESET ROLE RESET ROLE SELECT alter_role_if_exists('postgres', 'ALTER ROLE postgres SET lc_messages = ''C''') - SELECT citus_internal_add_partition_metadata ('mx_test_schema_1.mx_table_1'::regclass, 'h', 'col1', 4, 's') - SELECT citus_internal_add_partition_metadata ('mx_test_schema_2.mx_table_2'::regclass, 'h', 'col1', 4, 's') + SELECT citus_internal_add_partition_metadata ('mx_test_schema_1.mx_table_1'::regclass, 'h', 'col1', 5, 's') + SELECT citus_internal_add_partition_metadata ('mx_test_schema_2.mx_table_2'::regclass, 'h', 'col1', 5, 's') SELECT citus_internal_add_partition_metadata ('mx_testing_schema.mx_test_table'::regclass, 'h', 'col_1', 2, 's') - SELECT citus_internal_add_partition_metadata ('public.dist_table_1'::regclass, 'h', 'a', 10005, 's') - SELECT citus_internal_add_partition_metadata ('public.mx_ref'::regclass, 'n', NULL, 10003, 't') - SELECT citus_internal_add_partition_metadata ('public.test_table'::regclass, 'h', 'id', 10005, 's') + SELECT citus_internal_add_partition_metadata ('public.dist_table_1'::regclass, 'h', 'a', 10010, 's') + SELECT citus_internal_add_partition_metadata ('public.mx_ref'::regclass, 'n', NULL, 10009, 't') + SELECT citus_internal_add_partition_metadata ('public.test_table'::regclass, 'h', 'id', 10010, 's') SELECT pg_catalog.worker_drop_sequence_dependency(logicalrelid::regclass::text) FROM pg_dist_partition SELECT pg_catalog.worker_record_sequence_dependency('mx_testing_schema.mx_test_table_col_3_seq'::regclass,'mx_testing_schema.mx_test_table'::regclass,'col_3') SELECT worker_apply_sequence_command ('CREATE SEQUENCE IF NOT EXISTS mx_testing_schema.mx_test_table_col_3_seq AS bigint INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1 NO CYCLE','bigint') @@ -1924,7 +1924,7 @@ SELECT unnest(activate_node_snapshot()) order by 1; SET citus.enable_ddl_propagation TO 'on' SET citus.enable_ddl_propagation TO 'on' UPDATE pg_dist_local_group SET groupid = 1 - WITH colocation_group_data (colocationid, shardcount, replicationfactor, distributioncolumntype, distributioncolumncollationname, distributioncolumncollationschema) AS (VALUES (10002, 7, 1, 'integer'::regtype, NULL, NULL), (10003, 1, -1, 0, NULL, NULL), (10004, 3, 1, 'integer'::regtype, NULL, NULL), (10005, 4, 1, 'integer'::regtype, NULL, NULL)) SELECT pg_catalog.citus_internal_add_colocation_metadata(colocationid, shardcount, replicationfactor, distributioncolumntype, coalesce(c.oid, 0)) FROM colocation_group_data d LEFT JOIN pg_collation c ON (d.distributioncolumncollationname = c.collname AND d.distributioncolumncollationschema::regnamespace = c.collnamespace) + WITH colocation_group_data (colocationid, shardcount, replicationfactor, distributioncolumntype, distributioncolumncollationname, distributioncolumncollationschema) AS (VALUES (10009, 1, -1, 0, NULL, NULL), (10010, 4, 1, 'integer'::regtype, NULL, NULL)) SELECT pg_catalog.citus_internal_add_colocation_metadata(colocationid, shardcount, replicationfactor, distributioncolumntype, coalesce(c.oid, 0)) FROM colocation_group_data d LEFT JOIN pg_collation c ON (d.distributioncolumncollationname = c.collname AND d.distributioncolumncollationschema::regnamespace = c.collnamespace) WITH distributed_object_data(typetext, objnames, objargs, distargumentindex, colocationid, force_delegation) AS (VALUES ('sequence', ARRAY['public', 'user_defined_seq']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['mx_testing_schema', 'mx_test_table_col_3_seq']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_testing_schema', 'mx_test_table']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_1', 'mx_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['mx_test_schema_2', 'mx_table_2']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'mx_ref']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'dist_table_1']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_0']::text[], ARRAY[]::text[], -1, 0, false), ('sequence', ARRAY['public', 'mx_test_sequence_1']::text[], ARRAY[]::text[], -1, 0, false), ('table', ARRAY['public', 'test_table']::text[], ARRAY[]::text[], -1, 0, false), ('role', ARRAY['postgres']::text[], ARRAY[]::text[], -1, 0, false), ('database', ARRAY['regression']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['public']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_testing_schema_2']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_1']::text[], ARRAY[]::text[], -1, 0, false), ('schema', ARRAY['mx_test_schema_2']::text[], ARRAY[]::text[], -1, 0, false)) SELECT citus_internal_add_object_metadata(typetext, objnames, objargs, distargumentindex::int, colocationid::int, force_delegation::bool) FROM distributed_object_data; WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310000, 1, 0, 1, 100000), (1310001, 1, 0, 5, 100001), (1310002, 1, 0, 1, 100002), (1310003, 1, 0, 5, 100003), (1310004, 1, 0, 1, 100004), (1310005, 1, 0, 5, 100005), (1310006, 1, 0, 1, 100006), (1310007, 1, 0, 5, 100007)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data; WITH placement_data(shardid, shardstate, shardlength, groupid, placementid) AS (VALUES (1310020, 1, 0, 1, 100020), (1310021, 1, 0, 5, 100021), (1310022, 1, 0, 1, 100022), (1310023, 1, 0, 5, 100023), (1310024, 1, 0, 1, 100024)) SELECT citus_internal_add_placement_metadata(shardid, shardstate, shardlength, groupid, placementid) FROM placement_data; diff --git a/src/test/regress/sql/multi_colocation_utils.sql b/src/test/regress/sql/multi_colocation_utils.sql index 245c2ce6d..15bb4d739 100644 --- a/src/test/regress/sql/multi_colocation_utils.sql +++ b/src/test/regress/sql/multi_colocation_utils.sql @@ -236,7 +236,7 @@ SELECT * FROM pg_dist_colocation WHERE colocationid = 4; -- check to see whether metadata is synced SELECT nodeport, unnest(result::jsonb[]) FROM run_command_on_workers($$ -SELECT array_agg(row_to_json(c)) FROM pg_dist_colocation c WHERE colocationid = 4 +SELECT coalesce(array_agg(row_to_json(c)), '{}') FROM pg_dist_colocation c WHERE colocationid = 4 $$); -- create dropped colocation group again