Re: Recovering data via raw table and field separators - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Recovering data via raw table and field separators
Date
Msg-id 20071205170526.GA17006@alvh.no-ip.org
Whole thread Raw
In response to Re: Recovering data via raw table and field separators  ("John Wells" <jb@sourceillustrated.com>)
Responses Re: Recovering data via raw table and field separators
List pgsql-general
John Wells wrote:
> On 12/5/07, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > John Wells wrote:
> >
> > > I have pg_filedump installed, but can't figure out how to dump the
> > > rows themselves. I get the equivalent of the output at the end of this
> > > post. Looking over the --help, there's nothing obvious that has gotten
> > > me further.
> >
> > -i is the option you need; but you have to keep in mind that it won't
> > show you the textual representation of data.  It will only get you
> > internal representation (binary).
>
> Well, then isn't that no better than having the raw table file in this
> case? What I really need is a way to just spit out all tuples in the
> file in a readable format, regardless of whether they've been marked
> deleted. Is there any way to do this?

Not that I know of.

I think the simplest thing to get your tuples back is:

1. mark the transaction that deleted them as aborted in pg_clog
2. reset the hint bits in the deleted tuples, or hack your postgres copy
to ignore hint bits

You can figure out the transaction that deleted the tuples by seeing
that their Xmax value is with pg_filedump.

The hint bits part makes it rather messy :-(

Please keep the list on CC:.

--
Alvaro Herrera                 http://www.amazon.com/gp/registry/DXLWNGRJD34J
"Puedes vivir solo una vez, pero si lo haces bien, una vez es suficiente"

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Recovering data via raw table and field separators
Next
From: Erik Jones
Date:
Subject: Re: Moving pgstat.stat and pgstat.tmp