WARNING

This text was automatically converted from troff me macros to HTML. Information may have been lost, added, or changed in the process. Lars Aronsson and Lysator do not guarantee the correctness of this HTML document.

NAME

pagedoc - POSTGRES page doctor

SYNOPSIS

pagedoc [ "-h|b|r" ] [ "-d level" ] filename

DESCRIPTION

The pagedoc program understands the layout of data on POSTGRES pages, and can be used to view contents of relations in case a database gets corrupted. Contents are printed to standard output, and probable errors are flagged with four asterisks (``****'') and a description of the problem.

Several levels of detail are available. Level zero prints only a single summary line per data page in the relation. The summary line includes the number of items on the page, some allocation information, and whatever additional detail is appropriate for the relation type being examined. Level one also prints a single summary line for each tuple that appears on each page. The tuple summary includes the tuple's position on the page, its length, and some allocation information. Level two (or higher) prints all of the information printed by level one, and prints tuple headers for every tuple on the page. The header information displayed depends on the type of relation being viewed; either HeapTuple or IndexTuple structure entries are possible.

If the relation's contents are badly damaged, then only level zero is likely to work. Finer levels of detail assume that more page structure is correct, and so are more sensitive to corruption.

ARGUMENTS

"-h|b|r" The type of the relation. Type h is heap, b is btree, and r is rtree. The default is h .

"-d level" The detail level to use in displaying pages.

filename The name of the file containing the relation.

EXAMPLES

To print page and line pointer summaries and tuple headers for a btree index named pg_typeidind ,


pagedoc -b -d2 pg_typeidind

To show the default (level zero) summary of a heap relation named pg_user ,


pagedoc pg_user

BUGS

Finer levels of detail produce a lot of output.

There's no way to skip forward to a page that shows some corruption.

You can only examine contents, you can't actually fix them.