Recover an existing database - Mailing list pgsql-general

From Peter Bayley
Subject Recover an existing database
Date
Msg-id 006701c19e26$0e3206f0$cd4d8990@homer2
Whole thread Raw
Responses Re: Recover an existing database
List pgsql-general
Apologies if I'm posting this in the wrong forum.  I have tried to get help from comp.databases.postgresql.hackers without success.
 
I had a hard disk crash recently and had to reinstall  Linux (RedHat 7.2) and consequently postgres (7.1.3) on the new root disk.  My large database (also 7.1.3) was mounted on another volume and I had created it using the "CREATE DATABASE WITH LOCATION=" syntax.
 
My question is:  How can I change the new postgres install to recognise my existing database?  I renamed the existing database directory and successfully created a new database area using initlocation and rebooted the postmaster with the PGDATA2 env variable set.  I created a new
database using CREATE DATABASE WITH LOCATION='PGDATA2' and that went okay.  Then I dropped the postmaster and moved the directories around so that the existing database was renamed to the new one.  The postmaster came up okay but psql said the database was "pre 7.0" which it isn't.  So I'm sure I'm missing something somewhere (pg_database?)  I know what I'm doing is pretty tweeky but I would really like not to have to rebuild this database if at all possible.
 
If this type of functionality is not available, perhaps it could be considered as a future addition.  Using /var as the default location is understandable but typically / is not a large file system and I would assume use of other locations for data storage to be pretty common.
 
Hoping you can help
 
Peter
Sydney, Australia

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: BLOB question + MS Access ODBC issue
Next
From: "Gregory Wood"
Date:
Subject: Re: "IS NOT NULL" != "NOT NULL"