Re: after using pg_resetxlog, db lost

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Shea,Dan [CIS]" <Dan(dot)Shea(at)ec(dot)gc(dot)ca>, pgsql-performance(at)postgresql(dot)org
Subject: Re: after using pg_resetxlog, db lost
Date: 2004-06-22 20:05:07
Message-ID: 40D890F3.8090208@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:
> "Shea,Dan [CIS]" <Dan(dot)Shea(at)ec(dot)gc(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-06-22 20:25:19 Re: after using pg_resetxlog, db lost
Previous Message Tom Lane 2004-06-22 19:36:03 Re: after using pg_resetxlog, db lost