mirror of https://github.com/citusdata/citus.git
Omit public schema from shard_name output
parent
e16805215d
commit
7f68f78ee9
|
@ -720,7 +720,15 @@ shard_name(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
schemaId = get_rel_namespace(relationId);
|
schemaId = get_rel_namespace(relationId);
|
||||||
schemaName = get_namespace_name(schemaId);
|
schemaName = get_namespace_name(schemaId);
|
||||||
qualifiedName = quote_qualified_identifier(schemaName, relationName);
|
|
||||||
|
if (strncmp(schemaName, "public", NAMEDATALEN) == 0)
|
||||||
|
{
|
||||||
|
qualifiedName = (char *) quote_identifier(relationName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qualifiedName = quote_qualified_identifier(schemaName, relationName);
|
||||||
|
}
|
||||||
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(qualifiedName));
|
PG_RETURN_TEXT_P(cstring_to_text(qualifiedName));
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
|
|
|
@ -1386,18 +1386,18 @@ JOIN
|
||||||
USING (shardid)
|
USING (shardid)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
id;
|
id;
|
||||||
id | shard_name | nodename | nodeport
|
id | shard_name | nodename | nodeport
|
||||||
----+----------------------+-----------+----------
|
----+---------------+-----------+----------
|
||||||
1 | public.users_1200022 | localhost | 57637
|
1 | users_1200022 | localhost | 57637
|
||||||
2 | public.users_1200025 | localhost | 57638
|
2 | users_1200025 | localhost | 57638
|
||||||
3 | public.users_1200023 | localhost | 57638
|
3 | users_1200023 | localhost | 57638
|
||||||
4 | public.users_1200023 | localhost | 57638
|
4 | users_1200023 | localhost | 57638
|
||||||
5 | public.users_1200022 | localhost | 57637
|
5 | users_1200022 | localhost | 57637
|
||||||
6 | public.users_1200024 | localhost | 57637
|
6 | users_1200024 | localhost | 57637
|
||||||
7 | public.users_1200023 | localhost | 57638
|
7 | users_1200023 | localhost | 57638
|
||||||
8 | public.users_1200022 | localhost | 57637
|
8 | users_1200022 | localhost | 57637
|
||||||
9 | public.users_1200025 | localhost | 57638
|
9 | users_1200025 | localhost | 57638
|
||||||
10 | public.users_1200022 | localhost | 57637
|
10 | users_1200022 | localhost | 57637
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
END;
|
END;
|
||||||
|
|
|
@ -39,9 +39,9 @@ SELECT shard_name(NULL, 666666);
|
||||||
SELECT shard_name(0, 666666);
|
SELECT shard_name(0, 666666);
|
||||||
ERROR: object_name does not reference a valid relation
|
ERROR: object_name does not reference a valid relation
|
||||||
SELECT shard_name('too_long_12345678901234567890123456789012345678901234567890'::regclass, 666666);
|
SELECT shard_name('too_long_12345678901234567890123456789012345678901234567890'::regclass, 666666);
|
||||||
shard_name
|
shard_name
|
||||||
------------------------------------------------------------------------
|
-----------------------------------------------------------------
|
||||||
public.too_long_12345678901234567890123456789012345678_e0119164_666666
|
too_long_12345678901234567890123456789012345678_e0119164_666666
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT shard_name('too_long_12345678901234567890123456789012345678901234567890'::regclass, NULL);
|
SELECT shard_name('too_long_12345678901234567890123456789012345678901234567890'::regclass, NULL);
|
||||||
|
@ -316,9 +316,9 @@ SELECT master_create_worker_shards(U&'elephant_!0441!043B!043E!043D!0441!043B!04
|
||||||
SELECT shard_name(U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D' UESCAPE '!'::regclass, min(shardid))
|
SELECT shard_name(U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D' UESCAPE '!'::regclass, min(shardid))
|
||||||
FROM pg_dist_shard
|
FROM pg_dist_shard
|
||||||
WHERE logicalrelid = U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D' UESCAPE '!'::regclass;
|
WHERE logicalrelid = U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D' UESCAPE '!'::regclass;
|
||||||
shard_name
|
shard_name
|
||||||
----------------------------------------------------------
|
---------------------------------------------------
|
||||||
public."elephant_слонслонслонсло_c8b737c2_2250000000002"
|
"elephant_слонслонслонсло_c8b737c2_2250000000002"
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
|
@ -86,7 +86,7 @@ step "s2-print-index-count"
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ step "s2-print-index-count"
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE schemaname || ''.'' || tablename = ''%s''')
|
run_command_on_placements('test_copy_placement_vs_modification', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue