Re: Documentation on page files - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Documentation on page files
Date
Msg-id 20020423092928.A10844@svana.org
Whole thread Raw
In response to Re: Documentation on page files  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Responses Re: Documentation on page files  (Hannu Krosing <hannu@tm.ee>)
List pgsql-hackers
On Mon, Apr 22, 2002 at 11:14:36AM -0500, Ross J. Reedstrom wrote:
> On Sun, Apr 21, 2002 at 07:28:32PM +1000, Martijn van Oosterhout wrote:
> > 
> > http://svana.org/kleptog/pgsql/page.sgml.txt
> > 
> > I don't know whatever SGML format this is using, so the layout is not great,
> > but the information should be accurate. I used it to create a program to
> > dump the datafiles directly without the postmaster :).
> 
> Excellent - since this is a FRP (Frequently Requested Program) how do you
> feel about dumping it in contrib? Even if it's hardcoded for your particular
> table structure, it could serve as a starting point for some poor DBA
> who's got to recover from a lost xlog, for example.

Actually, it reads the table structure from the catalog. It also will find
the right files to open. It reads files from both PG 6.5 and 7.2 although it
shouldn't be too hard to make work for other versions. And if you people
don't reorder the first few fields in pg_attribute, it will work for all
future versions too.

The dumping is more of an extra, the original idea was to check for errors
in the datafiles. Hence the working name of "pgfsck". At the moment the
dumping dumps only tuples where xmax == 0 but I'm not sure if that's
correct.

It doesn't handle compressed tuples nor toasted ones, though thats more
advanced really. And ofcourse outputing data in human readable format has to
be added for each type. I only started writing it on Sunday, so let me give
it a usable interface and I'll let people try it out.

-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Canada, Mexico, and Australia form the Axis of Nations That
> Are Actually Quite Nice But Secretly Have Nasty Thoughts About America


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: NAMEDATALEN revisited
Next
From: Michael Loftis
Date:
Subject: Re: What is wrong with hashed index usage?