pg_dump oid problems

From: steve <steve(at)jlajla(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_dump oid problems
Date: 2001-10-10 15:32:16
Message-ID: 3BC46A00.3CEAC7C4@jlajla.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Apologies for posting to [Hackers], have already posted to [Patches]
with no reply.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-10-10 16:52:46 Re: Encoding issues
Previous Message Dmitry Chernikov 2001-10-10 15:09:03 Problem in pg_dump 7.1.2 dump order