X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C5236D1B46E for ; Thu, 11 Dec 2003 06:09:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 85237-01 for ; Thu, 11 Dec 2003 02:09:21 -0400 (AST) Received: from jupiter.milkyway.org (p01.3c04.pm.dimcom.net [206.124.3.161]) by svr1.postgresql.org (Postfix) with ESMTP id 7B746D1B469 for ; Thu, 11 Dec 2003 02:09:19 -0400 (AST) Received: from dim.com (jtc@localhost) by jupiter.milkyway.org (8.11.6/8.11.6) with ESMTP id hBALuHb26108; Wed, 10 Dec 2003 14:56:29 -0700 Message-Id: <200312102156.hBALuHb26108@jupiter.milkyway.org> X-Authentication-Warning: jupiter.milkyway.org: jtc owned process doing -bs To: Tom Lane Cc: pgsql-admin@postgresql.org Subject: Re: Postrgres data restoration problem In-Reply-To: Your message of "Sun, 07 Dec 2003 22:13:56 EST." <1377.1070853236@sss.pgh.pa.us> Date: Wed, 10 Dec 2003 14:56:17 -0700 From: Jim Cochrane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/140 X-Sequence-Number: 11648 > Jim Cochrane writes: > >> How old? We need to know the exact PG version number. > > > cat PG_VERSION > > 7.2 > > That's not exact, it only tells the major release number. > "postmaster --version" was what I was looking for. It outputs: postmaster (PostgreSQL) 7.2.1 > > > However the server failed to start up, giving the following error messages: > > > postmaster successfully started > > DEBUG: database system was shut down at 2003-12-07 14:55:22 MST > > DEBUG: open of /home/pgsql/data/pg_xlog/0000000000000000 (log file 0, segm ent 0) failed: No such file or directory > > DEBUG: invalid primary checkpoint record > > DEBUG: open of /home/pgsql/data/pg_xlog/0000000000000000 (log file 0, segm ent 0) failed: No such file or directory > > DEBUG: invalid secondary checkpoint record > > FATAL 2: unable to locate a valid checkpoint record > > DEBUG: startup process (pid 31411) exited with exit code 2 > > DEBUG: aborting startup due to startup process failure > > This is ungood :-(. Your only hope at this point is to run pg_resetxlog > (which is not a standard part of the 7.2 distribution, but is available > as a contrib utility). If you are lucky, that will let you into the > database, but you should be aware of the possibility that you've lost > parts of the last few transactions and therefore have a > not-completely-consistent database. I guess I'm unlucky. I shut the server down and ran pg_resetxlog, which gave the error message: The database was not shut down cleanly. Resetting the xlog may cause data to be lost! If you want to proceed anyway, use -f to force reset. So I used the -f option and started the server up, which started successfully: postmaster successfully started DEBUG: database system was shut down at 2003-12-10 12:31:46 MST DEBUG: checkpoint record is at 0/2000010 DEBUG: redo record is at 0/2000010; undo record is at 0/2000010; shutdown TRUE DEBUG: next transaction id: 158; next oid: 16556 DEBUG: database system is ready However, the same problem occurs as before - When I use psql to connect to a database and then use \d to list the tables, there are not tables: No relations found. It appears to me that the metadata for the database tables got corrupted or blown away. It looks like it's time to give up. In case anyone's concerned, this data was important, but not critical - It hurts to loose it, but I'm not going to end up in jail because of it :-) Anyway, I appreciate you guys' help. I've learned some new things about postgres. Jim Cochrane