Re: Help with Database Recovery - Mailing list pgsql-general

From Tom Lane
Subject Re: Help with Database Recovery
Date
Msg-id 13011.975612253@sss.pgh.pa.us
Whole thread Raw
In response to RE: Help with Database Recovery  ("Hancock, David (DHANCOCK)" <DHANCOCK@arinc.com>)
List pgsql-general
"Hancock, David (DHANCOCK)" <DHANCOCK@arinc.com> writes:
> Sorry I didn't give more detail.  OS is Linux 2.2 kernel, PostgreSQL is
> 6.5.3.  The problem is that I copied the .../base/* directories elsewhere in
> preparation for making base a symlink to a different filesystem with more
> space.  I then screwed up and removed everything in /var/lib/pgsql, not just
> the base directories.  This necessitated a reinstall of PostgreSQL.

> I know, I know ... it was a very stupid maneuver on my part, but it's a
> strange feeling to know that I've GOT the database files, I just can't use
> 'em.  Yet.

Unfortunately, you've only got *part* of the database.  The above
maneuver destroyed your pg_log file, which is essential.  Without it,
you've got a lot of tuples but you don't know which ones are valid.

If you did a VACUUM just before all this, then there's a reasonable
chance that the tuples you have left are mostly just valid ones.
Otherwise I'd say it's hopeless.  In any case you will not be able
to reconstruct data that you can trust except after painstaking
manual examination.

How far back was your last regular whole-file-system backup?  Restoring
all of /var/lib/pgsql off that is likely to be your best shot at getting
to a state that's somewhat trustworthy.

            regards, tom lane

pgsql-general by date:

Previous
From: Elmar Haneke
Date:
Subject: Re: Can PostGreSQL handle 100 user database - more info
Next
From: "Francis Solomon"
Date:
Subject: RE: Can PostGreSQL handle 100 user database?