Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e91932e

Browse files
committed
Cleanup error messages in findLastBuiltinOid
1 parent fba790a commit e91932e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.173 2000/10/22 18:13:09 pjw Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.174 2000/10/22 23:16:55 pjw Exp $
2626
*
2727
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2828
*
@@ -3883,9 +3883,8 @@ setMaxOid(Archive *fout)
38833883
/*
38843884
* findLastBuiltInOid -
38853885
* find the last built in oid
3886-
* we do this by looking up the oid of 'template1' in pg_database,
3887-
* this is probably not foolproof but comes close
3888-
*/
3886+
* we do this by retrieving datlastsysoid from the pg_database entry for this database,
3887+
*/
38893888

38903889
static int
38913890
findLastBuiltinOid(const char* dbname)
@@ -3902,21 +3901,21 @@ findLastBuiltinOid(const char* dbname)
39023901
if (res == NULL ||
39033902
PQresultStatus(res) != PGRES_TUPLES_OK)
39043903
{
3905-
fprintf(stderr, "pg_dump error in finding the template1 database.");
3904+
fprintf(stderr, "pg_dump: error in finding the last system OID");
39063905
fprintf(stderr, "Explanation from backend: '%s'.\n", PQerrorMessage(g_conn));
39073906
exit_nicely(g_conn);
39083907
}
39093908
ntups = PQntuples(res);
39103909
if (ntups < 1)
39113910
{
3912-
fprintf(stderr, "pg_dump: couldn't find the template1 database.\n");
3913-
fprintf(stderr, "There is no 'template1' entry in the 'pg_database' table.\n");
3911+
fprintf(stderr, "pg_dump: couldn't find the pg_database entry.\n");
3912+
fprintf(stderr, "There is no entry in the 'pg_database' table for this database.\n");
39143913
exit_nicely(g_conn);
39153914
}
39163915
if (ntups > 1)
39173916
{
3918-
fprintf(stderr, "pg_dump: found more than one template1 database.\n");
3919-
fprintf(stderr, "There is more than one 'template1' entry in the 'pg_database' table\n");
3917+
fprintf(stderr, "pg_dump: found more than one matching database.\n");
3918+
fprintf(stderr, "There is more than one entry for this database in the 'pg_database' table\n");
39203919
exit_nicely(g_conn);
39213920
}
39223921
last_oid = atoi(PQgetvalue(res, 0, PQfnumber(res, "datlastsysoid")));

0 commit comments

Comments
 (0)