Re: recover of data directory - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: recover of data directory
Date
Msg-id 20060529152814.GF22206@surnet.cl
Whole thread Raw
In response to Re: recover of data directory  (Daniel Drotos <drdani@mazsola.iit.uni-miskolc.hu>)
List pgsql-admin
Daniel Drotos wrote:
> On Mon, 29 May 2006, Tom Lane wrote:
>
> >If you could identify which file is which, you could manually
> >reconstruct the directories, but I'm afraid the odds of doing that
>
> Postgresql data files do not identifying themselves (in their content)
> so it's an ext2fs problem. I'm trying to solve it, just for fun, and
> to get experience how can it be done.

You could guess what some files are, particularly the system catalogs,
by searching for known contents (for example, if you see the string
"pg_class" and "pg_attribute" you could think it's the file for pg_class
itself).  You could identify several system catalogs easily this way.
But for user tables it would be quite complicated.  I'd use the number
of atts as a first clue (assuming you have already restored the system
catalogs).

I don't know how you intend to guess at telling the pg_clog files apart
though :-)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-admin by date:

Previous
From: Daniel Drotos
Date:
Subject: Re: recover of data directory
Next
From: "Mitch Pirtle"
Date:
Subject: 8.0 install via fink on OS X, now what?