From: amit Date: Wed, 26 Apr 2017 16:03:20 +0900 Subject: [PATCH 3/5] Fix a bug in pg_dump's --binary-upgrade code Said bug caused pg_dump to emit invalid command to attach a partition to its parent. --- src/bin/pg_dump/pg_dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 5016c2de74..5f3ec51011 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15488,7 +15488,8 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) appendPQExpBufferStr(q, "::pg_catalog.regclass;\n"); } - if (numParents > 0) + /* Note that partitions are handled differently (see below) */ + if (numParents > 0 && !tbinfo->partitionOf) { appendPQExpBufferStr(q, "\n-- For binary upgrade, set up inheritance this way.\n"); for (k = 0; k < numParents; k++) -- 2.11.0 --------------7C4A920427E010BDD0F66129 Content-Type: text/x-diff; name="0004-Change-the-way-pg_dump-retrieves-partitioning-info.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0004-Change-the-way-pg_dump-retrieves-partitioning-info.patc"; filename*1="h"