X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B85FD9FA2C7 for ; Mon, 29 May 2006 12:28:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 21900-03 for ; Mon, 29 May 2006 12:28:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alvh.no-ip.org (201-221-200-231.bk11-dsl.surnet.cl [201.221.200.231]) by postgresql.org (Postfix) with ESMTP id 844B79FA16E for ; Mon, 29 May 2006 12:28:16 -0300 (ADT) Received: by alvh.no-ip.org (Postfix, from userid 1000) id 24A0FC3A214; Mon, 29 May 2006 11:28:15 -0400 (CLT) Date: Mon, 29 May 2006 11:28:15 -0400 From: Alvaro Herrera To: Daniel Drotos Cc: Tom Lane , pgsql-admin@postgresql.org Subject: Re: recover of data directory Message-ID: <20060529152814.GF22206@surnet.cl> Mail-Followup-To: Daniel Drotos , Tom Lane , pgsql-admin@postgresql.org References: <20060510080835.C087C9F931D@postgresql.org> <14037.1148914696@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060403 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/396 X-Sequence-Number: 21928 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