diff options
author | Pavan Deolasee | 2018-07-27 06:59:13 +0000 |
---|---|---|
committer | Pavan Deolasee | 2018-07-27 08:01:38 +0000 |
commit | 206ae9bd5fcb0b3d07d8414521698717cb00fd60 (patch) | |
tree | 8e85592e5c678f24b407adbb833799b460205edc | |
parent | 28dcb30a154e2ac18da679c12ae9a17b7ef6fa2f (diff) |
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.
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 9 |
1 files 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') |