diff options
author | Pavan Deolasee | 2018-07-27 12:19:38 +0000 |
---|---|---|
committer | Pavan Deolasee | 2018-07-31 07:07:26 +0000 |
commit | d27064c246ad280080b5db19929535b0199d8276 (patch) | |
tree | f6ece59df915118a063d74d16f7a15e5b17cb5ea | |
parent | 0e3770c14c3fb1858192feb7240343cb35ba013c (diff) |
Do not dump TO NODE clause for partition or child table
We missed this in the commit c168cc8d58c6e0d9710ef0aba1b846b7174e0a79. So deal
with it now.
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 55ae1cde2a..691c919427 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15498,39 +15498,42 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) * partiion table, in which case the information is derived from * the parent table. */ - if (tbinfo->pgxclocatortype != 'E' && !tbinfo->ispartition && - numParents == 0) + if (!tbinfo->ispartition && numParents == 0) { - /* N: DISTRIBUTE BY ROUNDROBIN */ - if (tbinfo->pgxclocatortype == 'N') + if (tbinfo->pgxclocatortype != 'E') { - appendPQExpBuffer(q, "\nDISTRIBUTE BY ROUNDROBIN"); - } - /* R: DISTRIBUTE BY REPLICATED */ - else if (tbinfo->pgxclocatortype == 'R') - { - appendPQExpBuffer(q, "\nDISTRIBUTE BY REPLICATION"); - } - /* H: DISTRIBUTE BY HASH */ - else if (tbinfo->pgxclocatortype == 'H') - { - int hashkey = tbinfo->pgxcattnum; - appendPQExpBuffer(q, "\nDISTRIBUTE BY HASH (%s)", - fmtId(tbinfo->attnames[hashkey - 1])); + /* N: DISTRIBUTE BY ROUNDROBIN */ + if (tbinfo->pgxclocatortype == 'N') + { + appendPQExpBuffer(q, "\nDISTRIBUTE BY ROUNDROBIN"); + } + /* R: DISTRIBUTE BY REPLICATED */ + else if (tbinfo->pgxclocatortype == 'R') + { + appendPQExpBuffer(q, "\nDISTRIBUTE BY REPLICATION"); + } + /* H: DISTRIBUTE BY HASH */ + else if (tbinfo->pgxclocatortype == 'H') + { + int hashkey = tbinfo->pgxcattnum; + appendPQExpBuffer(q, "\nDISTRIBUTE BY HASH (%s)", + fmtId(tbinfo->attnames[hashkey - 1])); + } + else if (tbinfo->pgxclocatortype == 'M') + { + int hashkey = tbinfo->pgxcattnum; + appendPQExpBuffer(q, "\nDISTRIBUTE BY MODULO (%s)", + fmtId(tbinfo->attnames[hashkey - 1])); + } } - else if (tbinfo->pgxclocatortype == 'M') + if (include_nodes && + tbinfo->pgxc_node_names != NULL && + tbinfo->pgxc_node_names[0] != '\0') { - int hashkey = tbinfo->pgxcattnum; - appendPQExpBuffer(q, "\nDISTRIBUTE BY MODULO (%s)", - fmtId(tbinfo->attnames[hashkey - 1])); + appendPQExpBuffer(q, "\nTO NODE (%s)", tbinfo->pgxc_node_names); } } - if (include_nodes && - tbinfo->pgxc_node_names != NULL && - tbinfo->pgxc_node_names[0] != '\0') - { - appendPQExpBuffer(q, "\nTO NODE (%s)", tbinfo->pgxc_node_names); - } + } #endif /* Dump generic options if any */ |