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/