X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F3030D1B209 for ; Tue, 22 Jun 2004 17:05:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59277-02 for ; Tue, 22 Jun 2004 20:05:11 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 00393D1B1C9 for ; Tue, 22 Jun 2004 17:05:07 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1BcrW0-000605-0Z; Tue, 22 Jun 2004 21:05:08 +0100 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 8540F17360; Tue, 22 Jun 2004 21:05:07 +0100 (BST) Message-ID: <40D890F3.8090208@archonet.com> Date: Tue, 22 Jun 2004 21:05:07 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: "Shea,Dan [CIS]" , pgsql-performance@postgresql.org Subject: Re: after using pg_resetxlog, db lost References: <644D07D3D59D8F408CD01AC2F833D8C62B9209@cisxa.cmc.int.ec.gc.ca> <21115.1087932963@sss.pgh.pa.us> In-Reply-To: <21115.1087932963@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/237 X-Sequence-Number: 7295 Tom Lane wrote: > "Shea,Dan [CIS]" 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