Re: after using pg_resetxlog, db lost - Mailing list pgsql-performance

From Richard Huxton
Subject Re: after using pg_resetxlog, db lost
Date
Msg-id 40D890F3.8090208@archonet.com
Whole thread Raw
In response to Re: after using pg_resetxlog, db lost  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: after using pg_resetxlog, db lost
List pgsql-performance
Tom Lane wrote:
> "Shea,Dan [CIS]" <Dan.Shea@ec.gc.ca> writes:
>
>>The pg_resetxlog was run as root. It caused ownership problems of
>>pg_control and xlog files.
>>Now we have no access to the data now through psql.  The data is still
>>there under /var/lib/pgsql/data/base/17347  (PWFPM_DEV DB name).  But
>>there is no reference to 36 of our tables in pg_class.  Also the 18
>>other tables that are reported in this database have no data in them.
>>Is there anyway to have the database resync or make it aware of the data
>>under /var/lib/pgsql/data/base/17347?
>>How can this problem be resolved?
>
>
> What this sounds like is that you reset the transaction counter along
> with the xlog, so that those tables appear to have been created by
> transactions "in the future".  This could be repaired by doing
> pg_resetxlog with a more appropriate initial transaction ID, but
> figuring out what that value should be is not easy :-(

Tom - would there be any value in adding this to a pg_dump? I'm assuming
the numbers attached to tables etc are their OIDs anyway, so it might be
a useful reference in cases like this.

--
   Richard Huxton
   Archonet Ltd

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: after using pg_resetxlog, db lost
Next
From: Tom Lane
Date:
Subject: Re: after using pg_resetxlog, db lost