diff options
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r-- | src/bin/pg_dump/common.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index 62ba98793c1..c9a806f10a6 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.24 1998/09/01 04:33:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.25 1998/09/20 03:18:42 momjian Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -116,7 +116,8 @@ findParentsByOid(TableInfo *tblinfo, int numTables, { int i, j; - int parentInd; + int parentInd, + selfInd; char **result; int numParents; @@ -139,6 +140,16 @@ findParentsByOid(TableInfo *tblinfo, int numTables, { parentInd = findTableByOid(tblinfo, numTables, inhinfo[i].inhparent); + if (parentInd < 0) + { + selfInd = findTableByOid(tblinfo, numTables, oid); + fprintf(stderr, + "failed sanity check, parent oid %s of table %s (oid %s) was not found\n", + inhinfo[i].inhparent, + (selfInd >= 0) ? tblinfo[selfInd].relname : "", + oid); + exit(2); + } result[j++] = tblinfo[parentInd].relname; } } @@ -387,6 +398,13 @@ flagInhAttrs(TableInfo *tblinfo, int numTables, { parentInd = findTableByName(tblinfo, numTables, tblinfo[i].parentRels[k]); + if (parentInd < 0) + { + /* shouldn't happen unless findParentsByOid is broken */ + fprintf(stderr, "failed sanity check, table %s not found by flagInhAttrs\n", + tblinfo[i].parentRels[k]); + exit(2); + } for (j = 0; j < tblinfo[i].numatts; j++) { if (strInArray(tblinfo[i].attnames[j], |