[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PostgresSQL database recovery



On Tue, 2002-10-22 at 20:06, Nils-Erik Svangård wrote:
> Hi!
> 
> Yesterday my main hd gave up (40gig up in smoke), /usr and /lib was on
> another hd so they where saved.
> in /lib there seems like the data from my postgressql databas survived,
> but now when I have reinstalled and try to access the data it says data
> test2 doesnt exist (thats the old database).
> I have just copied the old files over the new installation, since its
> the same version och postgres. Im running unstable, doesanyone know how
> to use the data again??

You need to copy the whole tree of $PGDATA.  (By default, that is in
/var/lib/postgres, unless you set it to be somewhere else.)  Its
contents should look like this:

olly@linda$ sudo ls $PGDATA
PG_VERSION  global   pg_hba.conf    pg_xlog	     postmaster.opts
base	    pg_clog  pg_ident.conf  postgresql.conf  postmaster.pid



To be clear, the database includes eseential files at the top level of
$PGDATA; you cannot simply copy part of the tree.


Your backup procedures should include the use of pg_dumpall to copy the
database either to another machine, or to a tape, or at least to another
disk in the same machine.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                            
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "I press toward the mark for the prize of the high 
      calling of God in Christ Jesus."         
                                   Philippians 3:14 



Reply to: