Re: data restore

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Alex Cheung Tin Ka" <tkcheung(at)vtc(dot)edu(dot)hk>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: data restore
Date: 2002-11-18 10:56:23
Message-ID: 200211181056.23385.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • data restore at 2002-11-16 03:06:22 from Alex Cheung Tin Ka

Browse pgsql-general by date

  From Date Subject
Next Message Roberto de Amorim 2002-11-18 11:13:25 Basic Trigger
Previous Message Scott Lamb 2002-11-18 07:14:30 Re: tree ordering with varbit