Re: data restore - Mailing list pgsql-general

From Richard Huxton
Subject Re: data restore
Date
Msg-id 200211181056.23385.dev@archonet.com
Whole thread Raw
In response to data restore  ("Alex Cheung Tin Ka" <tkcheung@vtc.edu.hk>)
List pgsql-general
On Saturday 16 Nov 2002 3:06 am, Alex Cheung Tin Ka wrote:
> Dear All,
>     I have wrongly update a column data in pg database. I have the backup
> of the data directory on the tape.  The problem is I don't want to affect
> other database, who can provide some suggestion.  I have ever try to find
> out the data director, but only a set of number appears and don't know what
> these number means.  How can I find out which number corresponds to with
> database.

Well - it's not quite as simple as that. You can't just restore a single file
even once you've identified the files (there is a utility in contrib called
oid2name IIRC which'll do this for you). The files are named for the oid of
the corresponding item (table, index).

Your best bet is to restore the *entire* data directory to a separate machine
with a clean install of Postgresql and use pg_dump to retrieve the table(s)
you want, then restore from that.

Always use pg_dump to backup your database - it guarantees an accurate
snapshot of your database.
--
  Richard Huxton

pgsql-general by date:

Previous
From: Scott Lamb
Date:
Subject: Re: tree ordering with varbit
Next
From: "Roberto de Amorim"
Date:
Subject: Basic Trigger