Re: Recovering data via raw table and field separators

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Recovering data via raw table and field separators
Дата
Msg-id 20071205170526.GA17006@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Recovering data via raw table and field separators  ("John Wells" <jb@sourceillustrated.com>)
Ответы Re: Recovering data via raw table and field separators  ("John Wells" <jb@sourceillustrated.com>)
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Recovering data via raw table and field separators
Следующее
От: Erik Jones
Дата:
Сообщение: Re: Moving pgstat.stat and pgstat.tmp