Re: Restore deleted records

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: CoL <col(at)mportal(dot)hu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Restore deleted records
Date: 2003-08-27 12:36:01
Message-ID: 20030827123601.GB25066@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Konstantin Petrenko wrote, On 8/26/2003 11:37 AM:
>
> >Hello.
> >
> >I accidentally deleted some recordes from my table. How can I restore
> >them? Is it possible in 7.3.3?
> if you have a dump, or you are still in a transaction, you can rollback.

I avoided responding earlier, hoping you could get some more detailed help.
Besides recovering from backup (or not committing the transaction if by
some chance you haven't already) you can probably get back data from the
deleted rows if you haven't run a vacuum since committing the delete.
I don't know the specifics of how to do this, but the initial step will
be to shut the database cluster down and make a copy of it before running
vacuum. Once vacuum has been run, the old tuples will start being written
over and you won't have a reliable way to recover the data. If you have
alrerady done a vacuum full, you probably won't be able to much of anything
back.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Popeanga Marian 2003-08-27 13:04:34 script to create a sample database
Previous Message Marco Vezzoli 2003-08-27 11:47:08 [OT?]*_fsm_* parameters in postgresql.conf: which versions supports them?