Re: [SQL] Data recovery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bob Kruger <bkruger(at)mindspring(dot)com>
Cc: pgsql-admin(at)postgreSQL(dot)org, pgsql-general(at)postgreSQL(dot)org, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Data recovery
Date: 1999-06-01 15:35:58
Message-ID: 21701.928251358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Bob Kruger <bkruger(at)mindspring(dot)com> 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.

regards, tom lane

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 1999-06-01 17:15:18 Re: [ADMIN] Re: [SQL] Data recovery
Previous Message Michael J Davis 1999-06-01 15:33:42 RE: [GENERAL][SQL] 'denormalising' with a select

Browse pgsql-sql by date

  From Date Subject
Next Message Pham, Thinh 1999-06-01 15:45:29 RE: [SQL] Column name's length
Previous Message Michael J Davis 1999-06-01 15:33:42 RE: [GENERAL][SQL] 'denormalising' with a select