12
12
* by PostgreSQL
13
13
*
14
14
* IDENTIFICATION
15
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.353 2003/10/08 03:52:32 momjian Exp $
15
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.354 2003/10/21 04:46:28 tgl Exp $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -5822,9 +5822,10 @@ setMaxOid(Archive *fout)
5822
5822
/*
5823
5823
* findLastBuiltInOid -
5824
5824
* find the last built in oid
5825
- * we do this by retrieving datlastsysoid from the pg_database entry for this database,
5825
+ *
5826
+ * For 7.1 and 7.2, we do this by retrieving datlastsysoid from the
5827
+ * pg_database entry for the current database
5826
5828
*/
5827
-
5828
5829
static Oid
5829
5830
findLastBuiltinOid_V71 (const char * dbname )
5830
5831
{
@@ -5864,10 +5865,11 @@ findLastBuiltinOid_V71(const char *dbname)
5864
5865
/*
5865
5866
* findLastBuiltInOid -
5866
5867
* find the last built in oid
5867
- * we do this by looking up the oid of 'template1' in pg_database,
5868
- * this is probably not foolproof but comes close
5869
- */
5870
-
5868
+ *
5869
+ * For 7.0, we do this by assuming that the last thing that initdb does is to
5870
+ * create the pg_indexes view. This sucks in general, but seeing that 7.0.x
5871
+ * initdb won't be changing anymore, it'll do.
5872
+ */
5871
5873
static Oid
5872
5874
findLastBuiltinOid_V70 (void )
5873
5875
{
@@ -5876,7 +5878,7 @@ findLastBuiltinOid_V70(void)
5876
5878
int last_oid ;
5877
5879
5878
5880
res = PQexec (g_conn ,
5879
- "SELECT oid from pg_database where datname = 'template1 '" );
5881
+ "SELECT oid FROM pg_class WHERE relname = 'pg_indexes '" );
5880
5882
if (res == NULL ||
5881
5883
PQresultStatus (res ) != PGRES_TUPLES_OK )
5882
5884
{
0 commit comments