Re: Recovering a database - Mailing list pgsql-hackers

From Matthew T. O'Connor
Subject Re: Recovering a database
Date
Msg-id 200201181959.g0IJxAS10604@neuromancer.ctlno.com
Whole thread Raw
In response to Re: Recovering a database  ("Steve Spencer" <stevenspencer@ozemail.com.au>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> > My question is - how can I tell PostgreSQL (which I've obviously had to
> > reinstall) to look at my existing database which was mounted on another
> > volume and is still intact.?.  In other words- Can you tell a
> > freshly-installed PostgreSQL to use an existing (same version) database?

> Peter,
>     I have not tried this but it is mentioned in the install docs that you
> can set and environment variable PGDATA2 I beleive, and this will make
> postgres look for the second data directory. I recommend searching for
> environment variables in the docs at postgres.org.

I would think that more than that, you just want to tell postgres to use that 
directory as the data directory.  When you start postgres you can specify the 
data dir with the -D argument.  If you are using the redhat RPMS, then 
postgres is probably started by /etc/init.d/postgres script.  You can look in 
there, find the line that starts postgres, or sets the variable, and then 
startup postgres.  I assume the old data dir is the same major version of 
postgres (7.1.x).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8SIDA8BXvT14W9HARAt+lAJ9ORQioRifTLcQWj7MrGh/ALC6OvgCfWyKk
twSYblpdOM1GfM4gCA0I6Bc=
=Z2Uv
-----END PGP SIGNATURE-----


pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: postgresql-7.2b5.tar.gz
Next
From: Tom Lane
Date:
Subject: Re: user types API wish list