Forum OpenACS Q&A: Re: database recovery: how does postgres unix work?

Collapse
Posted by Janine Ohmer on
A few things come to mind:

First, is the file actually there? If not, try running

find /mnt/oldboot -name pg_control

and see if it's there anywhere. You might be using the wrong PGDATA directory.

If it is there, what are it's permissions? You probably created a new postgres user on the new drive and it doesn't have the same user id as the old one, which can result in the user no longer owning it's files. If that's the case you'll see a number in the output from "ls -l" where you expected the name of the postgres user to be (or possibly some other username altogether if you happen to have a user on the new system that got assigned the same id).

Another possibility is that the rackspace folks mounted the drive in read-only mode.

Either way, the best fix is probably to copy the whole pgdata directory to your local drive, and then try again (pointing PGDATA at the new location, of course). That way you can chown and do any other fiddling that may be required without making irreversable changes to your only copy of the files. You might need to do the copy as root and then "chown -R postgres:postgres" (or whatever you called your user and it's group) on the copy.

Good luck!