fix-collation-mismatch-create-dist-table
Onur Tirtir 2025-10-17 13:00:57 +03:00
parent e0522bbc2b
commit ad3bc800f6
2 changed files with 56 additions and 56 deletions

View File

@ -281,15 +281,15 @@ SELECT
create table test_a_tbl_1(text_col text collate "C" unique);
create table test_a_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_a_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_a_tbl_2', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- make sure we assing them to different colocation groups
@ -302,8 +302,8 @@ select count(*) = 2 as colocationids_different from (
where pg_namespace.nspname = 'single_node'
and pg_class.relname in ('test_a_tbl_1', 'test_a_tbl_2')
) q;
colocationids_different
-------------------------
colocationids_different
---------------------------------------------------------------------
t
(1 row)
@ -311,15 +311,15 @@ DROP TABLE test_a_tbl_1, test_a_tbl_2;
create table test_d_tbl_1(text_col text collate "C" unique);
create table test_d_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_d_tbl_1', 'text_col', shard_count=>4);
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_d_tbl_2', 'text_col', shard_count=>6);
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select alter_distributed_table('test_d_tbl_2', shard_count=>4);
@ -327,9 +327,9 @@ NOTICE: creating a new table for single_node.test_d_tbl_2
NOTICE: moving the data of single_node.test_d_tbl_2
NOTICE: dropping the old single_node.test_d_tbl_2
NOTICE: renaming the new table to single_node.test_d_tbl_2
alter_distributed_table
-------------------------
alter_distributed_table
---------------------------------------------------------------------
(1 row)
-- make sure we assing them to different colocation groups
@ -342,8 +342,8 @@ select count(*) = 2 as colocationids_different from (
where pg_namespace.nspname = 'single_node'
and pg_class.relname in ('test_d_tbl_1', 'test_d_tbl_2')
) q;
colocationids_different
-------------------------
colocationids_different
---------------------------------------------------------------------
t
(1 row)
@ -351,9 +351,9 @@ DROP TABLE test_d_tbl_1, test_d_tbl_2;
create table test_b_tbl_1(text_col text collate "C" unique);
create table test_b_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_b_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- errors
@ -364,15 +364,15 @@ DROP TABLE test_b_tbl_1, test_b_tbl_2;
create table test_c_tbl_1(text_col text collate "C" unique);
create table test_c_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_c_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_c_tbl_2', 'text_col', colocate_with => 'none');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- errors

View File

@ -100,15 +100,15 @@ SET search_path TO "Update Colocation";
create table test_a_tbl_1(text_col text collate "C" unique);
create table test_a_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_a_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_a_tbl_2', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- make sure we assing them to different colocation groups
@ -123,8 +123,8 @@ select result as colocationids_different from run_command_on_all_nodes($$
and pg_class.relname in ('test_a_tbl_1', 'test_a_tbl_2')
) q;
$$);
colocationids_different
-------------------------
colocationids_different
---------------------------------------------------------------------
t
t
t
@ -134,15 +134,15 @@ DROP TABLE test_a_tbl_1, test_a_tbl_2;
create table test_d_tbl_1(text_col text collate "C" unique);
create table test_d_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_d_tbl_1', 'text_col', shard_count=>4);
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_d_tbl_2', 'text_col', shard_count=>6);
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select alter_distributed_table('test_d_tbl_2', shard_count=>4);
@ -150,9 +150,9 @@ NOTICE: creating a new table for "Update Colocation".test_d_tbl_2
NOTICE: moving the data of "Update Colocation".test_d_tbl_2
NOTICE: dropping the old "Update Colocation".test_d_tbl_2
NOTICE: renaming the new table to "Update Colocation".test_d_tbl_2
alter_distributed_table
-------------------------
alter_distributed_table
---------------------------------------------------------------------
(1 row)
-- make sure we assing them to different colocation groups
@ -167,8 +167,8 @@ select result as colocationids_different from run_command_on_all_nodes($$
and pg_class.relname in ('test_d_tbl_1', 'test_d_tbl_2')
) q;
$$);
colocationids_different
-------------------------
colocationids_different
---------------------------------------------------------------------
t
t
t
@ -178,9 +178,9 @@ DROP TABLE test_d_tbl_1, test_d_tbl_2;
create table test_b_tbl_1(text_col text collate "C" unique);
create table test_b_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_b_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- errors
@ -191,15 +191,15 @@ DROP TABLE test_b_tbl_1, test_b_tbl_2;
create table test_c_tbl_1(text_col text collate "C" unique);
create table test_c_tbl_2(text_col text collate "en-x-icu" unique);
select create_distributed_table('test_c_tbl_1', 'text_col');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
select create_distributed_table('test_c_tbl_2', 'text_col', colocate_with => 'none');
create_distributed_table
--------------------------
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- errors