Ensure transformCreateStmt allows partitioned table alongside regular table
authorPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 12:24:10 +0000 (17:54 +0530)
committerPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 12:24:10 +0000 (17:54 +0530)
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

index 708188f30087b33f7b4f52be9dcbd2cf5e5932fd..5e1e89c979c4428d1b3cd6967b7657d376d8afe5 100644 (file)
@@ -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",