From 139464b202db0f4ac1d9df9657205914cb923911 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 16 Aug 2021 14:25:59 +0200 Subject: [PATCH v2 1/2] pg_dump: Remove redundant relkind checks It is checked in flagInhTables() which relkinds can have parents. After that, those entries will have numParents==0, so we don't need to check the relkind again. --- src/bin/pg_dump/common.c | 8 +------- src/bin/pg_dump/pg_dump.c | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index 1f24e79665..7b85718075 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -501,13 +501,7 @@ flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables) int numParents; TableInfo **parents; - /* Some kinds never have parents */ - if (tbinfo->relkind == RELKIND_SEQUENCE || - tbinfo->relkind == RELKIND_VIEW || - tbinfo->relkind == RELKIND_MATVIEW) - continue; - - /* Don't bother computing anything for non-target tables, either */ + /* Don't bother computing anything for non-target tables */ if (!tbinfo->dobj.dump) continue; diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 6adbd20778..61ba557466 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -2725,12 +2725,7 @@ guessConstraintInheritance(TableInfo *tblinfo, int numTables) TableInfo **parents; TableInfo *parent; - /* Sequences and views never have parents */ - if (tbinfo->relkind == RELKIND_SEQUENCE || - tbinfo->relkind == RELKIND_VIEW) - continue; - - /* Don't bother computing anything for non-target tables, either */ + /* Don't bother computing anything for non-target tables */ if (!(tbinfo->dobj.dump & DUMP_COMPONENT_DEFINITION)) continue; -- 2.33.0