Index: src/bin/pg_dump/pg_dump.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.237
diff -c -r1.237 pg_dump.c
*** src/bin/pg_dump/pg_dump.c	2002/01/11 23:21:55	1.237
--- src/bin/pg_dump/pg_dump.c	2002/01/17 23:35:46
***************
*** 4545,4551 ****
  setMaxOid(Archive *fout)
  {
  	PGresult   *res;
- 	Oid			max_oid;
  	char		sql[1024];
  
  	res = PQexec(g_conn, "CREATE TEMPORARY TABLE pgdump_oid (dummy int4)");
--- 4542,4547 ----
***************
*** 4563,4575 ****
  		write_msg(NULL, "could not insert into pgdump_oid table: %s", PQerrorMessage(g_conn));
  		exit_nicely();
  	}
- 	max_oid = PQoidValue(res);
- 	if (max_oid == 0)
- 	{
- 		write_msg(NULL, "inserted invalid oid\n");
- 		exit_nicely();
- 	}
  	PQclear(res);
  	res = PQexec(g_conn, "DROP TABLE pgdump_oid;");
  	if (!res ||
  		PQresultStatus(res) != PGRES_COMMAND_OK)
--- 4559,4577 ----
  		write_msg(NULL, "could not insert into pgdump_oid table: %s", PQerrorMessage(g_conn));
  		exit_nicely();
  	}
  	PQclear(res);
+ 	strcpy(sql, "COPY pgdump_oid WITH OIDS FROM stdin;\n");
+ 
+ 			dumpCtx = (DumpContext *) malloc(sizeof(DumpContext));
+ 			dumpCtx->tblinfo = (TableInfo *) tblinfo;
+ 			dumpCtx->tblidx = 0;
+ 			dumpCtx->oids = true;
+ 
+ 			dumpFn = dumpClasses_nodumpData;
+ 
+ 	ArchiveEntry(fout, "0", "Max OID", "<Init>", NULL, sql, "", "", "",
+ 				 dumpCtx, dumpFn);
+ 
  	res = PQexec(g_conn, "DROP TABLE pgdump_oid;");
  	if (!res ||
  		PQresultStatus(res) != PGRES_COMMAND_OK)
***************
*** 4578,4594 ****
  		exit_nicely();
  	}
  	PQclear(res);
- 	if (g_verbose)
- 		write_msg(NULL, "maximum system oid is %u\n", max_oid);
- 	snprintf(sql, 1024,
- 			 "CREATE TEMPORARY TABLE pgdump_oid (dummy int4);\n"
- 			 "COPY pgdump_oid WITH OIDS FROM stdin;\n"
- 			 "%u\t0\n"
- 			 "\\.\n"
- 			 "DROP TABLE pgdump_oid;\n",
- 			 max_oid);
- 
- 	ArchiveEntry(fout, "0", "Max OID", "<Init>", NULL, sql, "", "", "", NULL, NULL);
  }
  
  /*
--- 4580,4585 ----
