Unable to restore table oids from pg_dump - Mailing list pgsql-general

From dharana
Subject Unable to restore table oids from pg_dump
Date
Msg-id 42496C98.2050000@dharana.net
Whole thread Raw
List pgsql-general
Hello list,

I've got a problem. I have a table like this:

  id                 | integer | not null
  item_table_oid    | oid     |
  item_row_id | oid     |


"id" is a serial field for this table,

"item_table_oid" is an oid referencing the oid of the table in the
pg_catalog.pg_class table

"item_row_id" is an oid that references the oid of a data row in the
table refered by item_table_oid

When I pg_dumpall -o and then I try to restore it in a clean cluster
every table has new OIDs so the item_table_oid is invalid.

I did a "DELETE FROM pg_class" and I learnt that it's a quick way of
erasing a database.

Isn't there any way of dumping the pg_class entries so the references
would still work after restoring in a clean env?

Thanks in advance,

--
Juan Alonso
http://gamersmafia.com | http://laflecha.net


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_xlog disk full error, i need help
Next
From: Alex Adriaanse
Date:
Subject: Re: Tracking row updates - race condition