diff options
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r-- | src/bin/pg_dump/common.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index 1f24e796651..3cabd82e9c7 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -228,6 +228,9 @@ getSchemaData(Archive *fout, int *numTablesPtr) pg_log_info("flagging inherited columns in subtables"); flagInhAttrs(fout->dopt, tblinfo, numTables); + pg_log_info("reading partitioning data"); + getPartitioningInfo(fout); + pg_log_info("reading indexes"); getIndexes(fout, tblinfo, numTables); @@ -280,7 +283,6 @@ static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables, InhInfo *inhinfo, int numInherits) { - DumpOptions *dopt = fout->dopt; int i, j; @@ -296,18 +298,18 @@ flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables, continue; /* - * Normally, we don't bother computing anything for non-target tables, - * but if load-via-partition-root is specified, we gather information - * on every partition in the system so that getRootTableInfo can trace - * from any given to leaf partition all the way up to the root. (We - * don't need to mark them as interesting for getTableAttrs, though.) + * Normally, we don't bother computing anything for non-target tables. + * However, we must find the parents of non-root partitioned tables in + * any case, so that we can trace from leaf partitions up to the root + * (in case a leaf is to be dumped but its parents are not). We need + * not mark such parents interesting for getTableAttrs, though. */ if (!tblinfo[i].dobj.dump) { mark_parents = false; - if (!dopt->load_via_partition_root || - !tblinfo[i].ispartition) + if (!(tblinfo[i].relkind == RELKIND_PARTITIONED_TABLE && + tblinfo[i].ispartition)) find_parents = false; } |