From 674a8c2e4f2027c86b713ecf9b80dfc878a35624 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Fri, 18 Sep 2020 10:05:34 +0200 Subject: [PATCH] Skip dumping column defaults for inherited cols --- src/bin/pg_dump/pg_dump.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index dce6af09c9..7ede31e41f 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -16296,6 +16296,15 @@ dumpAttrDef(Archive *fout, AttrDefInfo *adinfo) if (!adinfo->separate) return; + /* + * Skip if the column isn't local to the table's definition. Inherited + * columns are handled separately during binary_upgrade to ensure + * compatible column order in the relation files, so only skip for non- + * upgrade cases. + */ + if (!dopt->binary_upgrade && !tbinfo->attislocal[adnum - 1]) + return; + q = createPQExpBuffer(); delq = createPQExpBuffer(); -- 2.21.1 (Apple Git-122.3)