Re: How to access deleted but not vacuum'ed tuples?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Robert <robert(at)robert(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to access deleted but not vacuum'ed tuples?
Date: 2002-12-17 05:57:44
Message-ID: 20021217055744.GA10708@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 16, 2002 at 02:47:02PM +0100, Robert wrote:
> Hi,
>
> I've accidentaly updated too much of my table and I need to un-update
> it :-( Old tuples are supposed to be kept in the db till I run vacuum so
> I should be able to manually fix it - but how to access old versions of
> the deleted/updated tuples? Thanks for your help.

As a rule, it's impossible. You state that the tuples may kept until the
next vacuum, but that's not necessarily true. Space could be reused at any
time.

I suggest backups.

You may be able to recover by reading the data files directly but it's not
recommended. Look around for disk dumping programs that read postgres files.
pgfsck is one.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2002-12-17 07:04:24 current_timestamp without TZ in CREATE table
Previous Message Tom Lane 2002-12-17 05:44:13 Re: ORDER BY random() LIMIT 1 slowness