diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 32908242be2..b30b87ae66d 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -1911,6 +1911,9 @@ dumpTableData(Archive *fout, TableDataInfo *tdinfo) DataDumperPtr dumpFn; char *copyStmt; + /* We had better have loaded per-column details about this table */ + Assert(tbinfo->interesting); + if (!dopt->dump_inserts) { /* Dump/restore using COPY */ @@ -2064,6 +2067,9 @@ makeTableDataInfo(DumpOptions *dopt, TableInfo *tbinfo, bool oids) addObjectDependency(&tdinfo->dobj, tbinfo->dobj.dumpId); tbinfo->dataObj = tdinfo; + + /* Make sure that we'll collect per-column info for this table. */ + tbinfo->interesting = true; } /* @@ -13843,6 +13849,9 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) int j, k; + /* We had better have loaded per-column details about this table */ + Assert(tbinfo->interesting); + qrelname = pg_strdup(fmtId(tbinfo->dobj.name)); qualrelname = pg_strdup(fmtQualifiedDumpable(tbinfo));