Received: from orion.SAPserv.Hamburg.dsh.de (Tpolaris2.sapham.debis.de [53.2.131.8]) by hub.org (8.9.3/8.9.3) with SMTP id NAA15068; Tue, 1 Jun 1999 13:17:44 -0400 (EDT) (envelope-from wieck@debis.com) Received: by orion.SAPserv.Hamburg.dsh.de for pgsql-sql@postgreSQL.org id m10os8E-0003kLC; Tue, 1 Jun 99 19:15 MET DST Message-Id: From: wieck@debis.com (Jan Wieck) Subject: Re: [ADMIN] Re: [SQL] Data recovery To: tgl@sss.pgh.pa.us (Tom Lane) Date: Tue, 1 Jun 1999 19:15:18 +0200 (MET DST) Cc: bkruger@mindspring.com, pgsql-admin@postgreSQL.org, pgsql-general@postgreSQL.org, pgsql-sql@postgreSQL.org Reply-To: jwieck@debis.com (Jan Wieck) In-Reply-To: <21701.928251358@sss.pgh.pa.us> from "Tom Lane" at Jun 1, 99 11:35:58 am X-Mailer: ELM [version 2.4 PL25] Content-Type: text Tom Lane wrote: > > Bob Kruger writes: > > I am recovering a system from a complete HD crash. > > I have a backup of the Postgres data directory, e.g. > > /usr/local/pgsql/data/base. > > Is there a way or method to have Postgres pick these databases up again? > > The version of Postgres run in this machine was/is 6.4.2. > > If you have a backup of the whole pgsql/data directory, just reinstall > the same Postgres release, restore the data directory (instead of doing > an initdb), and you should be in fat city. > > If you only have the data/base subdirectory, you will need to work > harder; you'll have to regenerate the top-level files. I think if you > get pg_shadow and pg_database right you will be OK. First, install and > initdb to get a basic set of files. You will need to recall the old set > of users (including their userIDs) in order to reconstruct pg_shadow. > After you've done the createusers, issue a createdb for each old > database (subdirectory of base/) so that they have entries in > pg_database. Then, shut down the postmaster, blow away the contents of > the base/ subdirectory and restore it from tape, and restart. I think > it'll work... > > In any case it's critical to install the same Postgres version you > were using. NO - this cannot work. He surely needs the entire data directory because the information in the heap's relies on the bits in data/pg_log. And that info (which XID's are committed and which not) cannot be reconstructed from the files - no chance. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #======================================== jwieck@debis.com (Jan Wieck) #