Help with Database Recovery

From: "Hancock, David (DHANCOCK)" <DHANCOCK(at)arinc(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Cc: "Hancock, David (DHANCOCK)" <DHANCOCK(at)arinc(dot)com>
Subject: Help with Database Recovery
Date: 2000-11-29 12:51:11
Message-ID: 09328AED5429D311A3000008C7911B1007CF7BED@exanpmb1.arinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Please--I have searched everywhere I can think of and have found no guidance
for recovering databases where the /var/lib/pgsql/base directories are
intact but there's no pg_dump file to work from. I need to do this because
I stupidly but inadvertently uninstalled PostgreSQL and then had to
reinstall it.

Some things that I tried:

1. just copy the old base/* directories into the newly created
/var/lib/pgsql/base directory. psql was not aware of the databases.
2. use createdb to create a database, and then copy the old data files into
the corresponding base/<db> directory. psql said "couldn't open cache for
user 40" or something similar.
3. modified uid for postgres user to 40, reinstalled PostgreSQL, did "2"
again, similar result.

I'd be very grateful for suggestions on where to look for guidance for this
kind of recovery, and I'll summarize my findings to the list.

It was a great irony that Chapter (lucky) 13 in the Admin documentation
("Database Recovery") only says "This section needs to be written.
Volunteers?" If I learn something, I'll be sure to write it up.

Original message to list:

> I have inadvertently uninstalled PostgreSQL and subsequently reinstalled
> it, which has rendered my existing databases inaccessible. I'd like to be
> able to recover them. There is no pgdump output to work from.
>
> If anyone knows of a description of how to recover the data withing the
> (intact) datafiles from the directories in /var/lib/pgsql/base, I'd be
> very grateful to learn of it.
>
> I have searched the documentation and the Momjian book and the
> postgresql.org site, but haven't found anything that helps me.
>
> If I'm barking up the wrong list, I'd like to know that, too.
>
> Cheers!
> --
> David Hancock | dhancock(at)arinc(dot)com | 410-266-4384
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin A. Marques 2000-11-29 12:51:16 Postgres BLOBS and PHP
Previous Message Anand Raman 2000-11-29 12:44:16 insertion times ..