aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/common.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-09-20 03:18:43 +0000
committerBruce Momjian <bruce@momjian.us>1998-09-20 03:18:43 +0000
commit3ac9688ae80ec6bcbb9bdafa8ef30eadc8c6dd6e (patch)
treec621f94a9ababac8773d1940cde7ddd8312d3de1 /src/bin/pg_dump/common.c
parent087eb4cd1a1faba95699b642883ba588bf709157 (diff)
downloadpostgresql-3ac9688ae80ec6bcbb9bdafa8ef30eadc8c6dd6e.tar.gz
postgresql-3ac9688ae80ec6bcbb9bdafa8ef30eadc8c6dd6e.zip
I also noticed that pg_dump contains a copy of the same
prompt_for_password code that psql does. We fixed psql a month or two back to permit usernames and passwords longer than 8 characters. I propagated the same fix into pg_dump. Tom Lane
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r--src/bin/pg_dump/common.c22
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],