Skip site navigation (1) Skip section navigation (2)

pg_dump oid problems

From: steve <steve(at)jlajla(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: pg_dump oid problems
Date: 2001-10-08 16:34:51
Message-ID: 3BC1D5AB.464057DD@jlajla.com (view raw or flat)
Thread:
Lists: pgsql-patches
When trying to pg_dump on 7.1.2 (& 7.1.3) I get the following error
message:

bash-2.04$ pg_dump dwh
getTables(): SELECT (for PRIMARY KEY NAME) failed for table nlcdmp.
Explanation from backend: ERROR:  dtoi4: integer out of range
bash-2.04$ pg_dump -v dwh
--  saving database definition
--  last builtin oid is 18539
--  reading user-defined types
--  reading user-defined functions
--  reading user-defined aggregates
--  reading user-defined operators
--  reading user-defined tables
getTables(): SELECT (for PRIMARY KEY NAME) failed for table nlcdmp.
Explanation from backend: ERROR:  dtoi4: integer out of range


I have already applied the patches described by Martin Weinberg and Tom
Lane (see below),  but  this doesn't deem to have fixed my problem.
---------
--- pg_dump.cThu Sep  6 21:18:21 2001
+++ pg_dump.c.origThu Sep  6 21:19:08 2001
@@ -2289,7 +2289,7 @@

 resetPQExpBuffer(query);
 appendPQExpBuffer(query,
-  "SELECT Oid FROM pg_index i WHERE i.indisprimary AND i.indrelid =
'%s'::oid ",
+  "SELECT Oid FROM pg_index i WHERE i.indisprimary AND i.indrelid = %s
",
   tblinfo[i].oid);
 res2 = PQexec(g_conn, query->data);
 if (!res2 || PQresultStatus(res2) != PGRES_TUPLES_OK)
@@ -3035,7 +3035,6 @@
 query = createPQExpBuffer();
 appendPQExpBuffer(query, "SELECT description FROM pg_description WHERE
objoid = ");
 appendPQExpBuffer(query, oid);
-appendPQExpBuffer(query, "::oid");

 /*** Execute query ***/

--------

Several of my tables have very large OIDs (over 4 billion in some cases
! don't know why) ,  these are obviously also causing dtoi4 error
messages when entering table design in pgaccess, but one can carry on
past the messages and continue working. I am also having problems in
CodeCharge using the ODBC driver - Codecharge fails to get column names
for tables with high OIDs. Tables with lower OIDs in the same database
work fine :-)

I've had no problems with any previous version of PostgreSQL much of the
data in this database has been progressively migrated over the last
couple of years from 6.2.

My interest in pg_dump is to dump my database without OIDs (normally I
dump with OIDs so I've been carrying these big numbers for some time),
drop everything and rebuild (psql < data.out) so that I hopefully get
new smaller OIDs generated. Is this likely to work if I get round the
pg_dump problems?

Anyway, what's needed now is suggestions as to what else I must do to
get pg_dump working with my large OIDs, any ideas??

Thanks,

Steve





pgsql-patches by date

Next:From: Patrice HédéDate: 2001-10-08 19:35:44
Subject: Re: [HACKERS] Unicode combining characters
Previous:From: Tom LaneDate: 2001-10-08 15:06:36
Subject: Re: Efficient slicing/substring of TOAST values (for comment)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group