From 4321286005f7f4768ffb02200d30ad2b29f8cbba Mon Sep 17 00:00:00 2001 From: Ahmet Gedemenli Date: Wed, 3 May 2023 16:04:56 +0300 Subject: [PATCH] Disable master_create_empty_shard udf for single shard tables (#6902) --- src/backend/distributed/operations/stage_protocol.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/distributed/operations/stage_protocol.c b/src/backend/distributed/operations/stage_protocol.c index 7ef988e5f..db7ebefca 100644 --- a/src/backend/distributed/operations/stage_protocol.c +++ b/src/backend/distributed/operations/stage_protocol.c @@ -138,6 +138,13 @@ master_create_empty_shard(PG_FUNCTION_ARGS) errdetail("We currently don't support creating shards " "on hash-partitioned tables"))); } + else if (IsCitusTableType(relationId, SINGLE_SHARD_DISTRIBUTED)) + { + ereport(ERROR, (errmsg("relation \"%s\" is a single shard table", + relationName), + errdetail("We currently don't support creating shards " + "on single shard tables"))); + } else if (IsCitusTableType(relationId, REFERENCE_TABLE)) { ereport(ERROR, (errmsg("relation \"%s\" is a reference table",