From 206ae9bd5fcb0b3d07d8414521698717cb00fd60 Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Fri, 27 Jul 2018 12:29:13 +0530 Subject: [PATCH] Do not dump DISTRIBUTED BY for partition and inherited table Child tables inherit the distribition property from the parent table. Even more, XL doesn't support a syntax of the form PARTITION OF .. DISTRIBUTED BY and doesn't allow child tables to have a distribution property different than the parent. So attaching this clause to the partition table does not make any sense. Per report from Virendra Kumar. --- src/bin/pg_dump/pg_dump.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 3e5213bfc5..545106baee 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15493,8 +15493,13 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) #ifdef PGXC if (fout->isPostgresXL) { - /* Add the grammar extension linked to PGXC depending on data got from pgxc_class */ - if (tbinfo->pgxclocatortype != 'E') + /* + * Add table distribution syntax, unless we're dealing with a + * partiion table, in which case the information is derived from + * the parent table. + */ + if (tbinfo->pgxclocatortype != 'E' && !tbinfo->ispartition && + numParents == 0) { /* N: DISTRIBUTE BY ROUNDROBIN */ if (tbinfo->pgxclocatortype == 'N') -- 2.39.5