aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r--src/bin/pg_dump/common.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index ba53c66098a..64e7dc89f13 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -85,8 +85,7 @@ static catalogid_hash *catalogIdHash = NULL;
static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables,
InhInfo *inhinfo, int numInherits);
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables);
-static void flagInhAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo,
- int numTables);
+static void flagInhAttrs(Archive *fout, TableInfo *tblinfo, int numTables);
static int strInArray(const char *pattern, char **arr, int arr_size);
static IndxInfo *findIndexByOid(Oid oid);
@@ -230,7 +229,7 @@ getSchemaData(Archive *fout, int *numTablesPtr)
getTableAttrs(fout, tblinfo, numTables);
pg_log_info("flagging inherited columns in subtables");
- flagInhAttrs(fout, fout->dopt, tblinfo, numTables);
+ flagInhAttrs(fout, tblinfo, numTables);
pg_log_info("reading partitioning data");
getPartitioningInfo(fout);
@@ -478,8 +477,7 @@ flagInhIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
* What we need to do here is:
*
* - Detect child columns that inherit NOT NULL bits from their parents, so
- * that we needn't specify that again for the child. (Versions >= 17 no
- * longer need this.)
+ * that we needn't specify that again for the child.
*
* - Detect child columns that have DEFAULT NULL when their parents had some
* non-null default. In this case, we make up a dummy AttrDefInfo object so
@@ -499,8 +497,9 @@ flagInhIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
* modifies tblinfo
*/
static void
-flagInhAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTables)
+flagInhAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
{
+ DumpOptions *dopt = fout->dopt;
int i,
j,
k;
@@ -562,8 +561,7 @@ flagInhAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTables
{
AttrDefInfo *parentDef = parent->attrdefs[inhAttrInd];
- foundNotNull |= (parent->notnull_constrs[inhAttrInd] != NULL &&
- !parent->notnull_noinh[inhAttrInd]);
+ foundNotNull |= parent->notnull[inhAttrInd];
foundDefault |= (parentDef != NULL &&
strcmp(parentDef->adef_expr, "NULL") != 0 &&
!parent->attgenerated[inhAttrInd]);
@@ -581,9 +579,8 @@ flagInhAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTables
}
}
- /* In versions < 17, remember if we found inherited NOT NULL */
- if (fout->remoteVersion < 170000)
- tbinfo->notnull_inh[j] = foundNotNull;
+ /* Remember if we found inherited NOT NULL */
+ tbinfo->inhNotNull[j] = foundNotNull;
/*
* Manufacture a DEFAULT NULL clause if necessary. This breaks