UnDelete?

Started by Postgres DBAalmost 27 years ago2 messages
#1Postgres DBA
postgres@nest.bistbn.com

hi, hackers!
If someone can, please help me!

I deleted by an accident some vital data from a table, and now I'm
wondering is it possible to "undelete" at least some of deleted records
until they are not finally sweeped out with vacuum. If yes, how do it?

TIA,
Aleksey.

#2Hannu Krosing
hannu@trust.ee
In reply to: Postgres DBA (#1)
Re: [HACKERS] UnDelete?

Postgres DBA wrote:

hi, hackers!
If someone can, please help me!

I deleted by an accident some vital data from a table, and now I'm
wondering is it possible to "undelete" at least some of deleted records
until they are not finally sweeped out with vacuum. If yes, how do it?

This used to be the case on older verions of Postgres, then you had to
only give the time qualification of the period for which the data was
valid.
For some reason (performance ?) this feature was removed ;(

And I'm pretty sure that the data is still inside the tables, so some
creative work with hex editor inside a _copy_ of the table would be
able to get at it.
So as a first thing I advise you to make a copy of your database
backend directory, at least of the tables that contain your data.
(the db directory is the one you gave to postmaster at startup +
database name,
the datafiles for tables are named exactly same as tables)

Next, get the programmers docs (and/or read code ;), and start digging.

If you come up with some tools for salvaging lost data, share them :)

---------------
Hannu