22
22
*
23
23
*
24
24
* IDENTIFICATION
25
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.173 2000/10/2218:13:09 pjw Exp $
25
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.174 2000/10/2223:16:55 pjw Exp $
26
26
*
27
27
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
28
28
*
@@ -3883,9 +3883,8 @@ setMaxOid(Archive *fout)
3883
3883
/*
3884
3884
* findLastBuiltInOid -
3885
3885
* 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
+ */
3889
3888
3890
3889
static int
3891
3890
findLastBuiltinOid (const char * dbname )
@@ -3902,21 +3901,21 @@ findLastBuiltinOid(const char* dbname)
3902
3901
if (res == NULL ||
3903
3902
PQresultStatus (res )!= PGRES_TUPLES_OK )
3904
3903
{
3905
- fprintf (stderr ,"pg_dump error in finding thetemplate1 database. " );
3904
+ fprintf (stderr ,"pg_dump: error in finding thelast system OID " );
3906
3905
fprintf (stderr ,"Explanation from backend: '%s'.\n" ,PQerrorMessage (g_conn ));
3907
3906
exit_nicely (g_conn );
3908
3907
}
3909
3908
ntups = PQntuples (res );
3910
3909
if (ntups < 1 )
3911
3910
{
3912
- fprintf (stderr ,"pg_dump: couldn't find thetemplate1 database .\n" );
3913
- fprintf (stderr ,"There is no'template1' entry in the 'pg_database' table.\n" );
3911
+ fprintf (stderr ,"pg_dump: couldn't find thepg_database entry .\n" );
3912
+ fprintf (stderr ,"There is no entry in the 'pg_database' table for this database .\n" );
3914
3913
exit_nicely (g_conn );
3915
3914
}
3916
3915
if (ntups > 1 )
3917
3916
{
3918
- fprintf (stderr ,"pg_dump: found more than onetemplate1 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 onematching database.\n" );
3918
+ fprintf (stderr ,"There is more than one entry for this database in the 'pg_database' table\n" );
3920
3919
exit_nicely (g_conn );
3921
3920
}
3922
3921
last_oid = atoi (PQgetvalue (res ,0 ,PQfnumber (res ,"datlastsysoid" )));