提交 8578af5e 编写于 作者: H Heikki Linnakangas

Fix gpcrondump of external tables.

Commit 821b8e10 changed pg_dump's shouldPrintColumn() function to return
true for all columns in an external table, and changed dumpExternal() to use
the shouldPrintColumn() function. However, that change was not made to the
copy of shouldPrintColumn() in cdb_dump_include.c.

That oversight didn't cause any ill effects, until commit 58b86683 came
along and refreshed cdb_dump_agent.c's copy of the dumpExternal() function,
to match that in pg_dump.c. With that change cdb_dump_agent's dumpExternal()
started to call shouldPrintColumn() for external tables, but its version of
shouldPrintColumn() didn't have the change to always return true for
external tables yet. As a result, external tables didn't have any of their
columns included.

To fix, update cdb_dump's copy of shouldPrintColumn() to match that in
pg_dump.c.
上级 4581f3fa
......@@ -3423,7 +3423,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
bool
shouldPrintColumn(TableInfo *tbinfo, int colno)
{
return (tbinfo->attislocal[colno] && !tbinfo->attisdropped[colno]);
return ((tbinfo->attislocal[colno] || tbinfo->relstorage == RELSTORAGE_EXTERNAL) &&
(!tbinfo->attisdropped[colno] /* || binary_upgrade */));
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册