From dfbd3a74cfa4369bce39de14cf94ff3b0f622b9a 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 v2 --- src/bin/pg_dump/pg_dump.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 76320468ba..e9998cf0cf 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -16285,6 +16285,13 @@ dumpAttrDef(Archive *fout, AttrDefInfo *adinfo) if (!adinfo->separate) return; + /* + * Skip if the column isn't local to the table's definition as the attrdef + * will be printed with the inheritance parent table definition + */ + if (!tbinfo->attislocal[adnum - 1]) + return; + q = createPQExpBuffer(); delq = createPQExpBuffer(); -- 2.21.1 (Apple Git-122.3)