dbTalk Databases Forums  

[BUGS] pg_dump --oids fails when default_with_oids = off

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] pg_dump --oids fails when default_with_oids = off in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default [BUGS] pg_dump --oids fails when default_with_oids = off - 01-04-2005 , 11:59 AM






PostgreSQL 8.0.0rc3

When default_with_oids is set to "off", pg_dump --oids fails with
the following error:

% pg_dump --oids test
pg_dump: inserted invalid OID

This prevents the ability to dump OIDs for tables that were created
WITH OIDS. The workaround is to set default_with_oids to "on".

The problem appears to be in setMaxOid() in src/bin/pg_dump/pg_dump.c:

do_sql_command(g_conn,
"CREATE TEMPORARY TABLE pgdump_oid (dummy integer)");
res = PQexec(g_conn, "INSERT INTO pgdump_oid VALUES (0)");
check_sql_result(res, g_conn, "INSERT INTO pgdump_oid VALUES (0)",
PGRES_COMMAND_OK);
max_oid = PQoidValue(res);
if (max_oid == 0)
{
write_msg(NULL, "inserted invalid OID\n");
exit_nicely();
}

Should the temporary table be created WITH OIDS, or is this a case
of "Doctor, it hurts when I do that"?

pg_restore might have a similar problem but I'll have to look at
that later this afternoon.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] pg_dump --oids fails when default_with_oids = off - 01-04-2005 , 03:59 PM






Michael Fuhr <mike (AT) fuhr (DOT) org> writes:
Quote:
When default_with_oids is set to "off", pg_dump --oids fails with
the following error:
% pg_dump --oids test
pg_dump: inserted invalid OID

Should the temporary table be created WITH OIDS,
Looks that way. Good catch.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.