From: Pavan Deolasee Date: Thu, 15 Jun 2017 12:24:10 +0000 (+0530) Subject: Ensure transformCreateStmt allows partitioned table alongside regular table X-Git-Tag: XL_10_R1BETA1~273 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dc11a82c58da80f76feeaaf6cc31b196ba4ace4f;p=postgres-xl.git 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. --- 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",