From 45f8017f4287a4af6741f076e95302958066861a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mehmet=20furkan=20=C5=9Fahin?= Date: Tue, 19 Jun 2018 16:29:36 +0300 Subject: [PATCH] create_distributed_table with fk to ref table is implemented --- src/backend/distributed/master/master_stage_protocol.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/distributed/master/master_stage_protocol.c b/src/backend/distributed/master/master_stage_protocol.c index e904d76a5..5b3239d62 100644 --- a/src/backend/distributed/master/master_stage_protocol.c +++ b/src/backend/distributed/master/master_stage_protocol.c @@ -668,6 +668,13 @@ WorkerCreateShard(Oid relationId, int shardIndex, uint64 shardId, List *ddlComma { referencedShardId = shardId; } + else if (PartitionMethod(referencedRelationId) == DISTRIBUTE_BY_NONE) + { + List *shardList = LoadShardList(referencedRelationId); + uint64 *shardIdPointer = (uint64 *) linitial(shardList); + + referencedShardId = (*shardIdPointer); + } else { referencedShardId = ColocatedShardIdInRelation(referencedRelationId,