From dc11a82c58da80f76feeaaf6cc31b196ba4ace4f Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Thu, 15 Jun 2017 17:54:10 +0530 Subject: [PATCH] Ensure transformCreateStmt allows partitioned table alongside regular table While dealing with XL distribution, we check if the table is a regular table or not. Since partitioned tables must get the same treatment as regular table as far as distribution goes, we check and allow partitioned tables too. --- src/backend/parser/parse_utilcmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 708188f300..5e1e89c979 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -427,7 +427,8 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString) Assert(IsA(inh, RangeVar)); rel = heap_openrv(inh, AccessShareLock); - if (rel->rd_rel->relkind != RELKIND_RELATION) + if ((rel->rd_rel->relkind != RELKIND_RELATION) && + (rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("inherited relation \"%s\" is not a table", -- 2.39.5