pg_filedump — display formatted contents of a Postgres Pro heap, index, or control file
pg_filedump [option...] [file]
pg_filedump is a utility to format
Postgres Pro
heap/index/control files into a human-readable form. You can
format/dump the files several ways, as listed in the
Options section,
as well as dump a straight binary.
The type of file (heap/index) can usually be determined
automatically by the content of the blocks within the file.
However, to format a pg_control file you must use
the -c option. The default is to format the entire
file using the block size listed in block 0 and display block relative
addresses. These defaults can be modified using run-time options.
Some options may seem strange but they are there for a reason.
For example, block size. It is there because if the header of
block 0 is corrupt, you need a method of forcing a block size.
pg_filedump is provided with Postgres Pro
as a separate pre-built package pg-filedump-std-15
(for the detailed installation instructions, see Chapter 16).
Defaults are: relative addressing, range of the entire file, block size as listed on block 0 in the file.
The following options are valid for heap and index files:
-aDisplay absolute addresses when formatting. Block header information is always block-relative.
-bDisplay binary block images within a range. The option will turn off all formatting options.
-dDisplay formatted block content dump. The option will turn off all other formatting options.
-D attrlistDecode tuples using given comma-separated list of types. The list of supported types:
bigint |
bigserial |
bool |
char |
charN — char(n) |
date |
float |
float4 |
float8 |
int |
json |
macaddr |
name |
numeric |
oid |
real |
serial |
smallint |
smallserial |
text |
time |
timestamp |
timetz |
uuid |
varchar |
varcharN — varchar(n) |
xid |
xml |
~ — ignore all attributes left in a tuple |
-fDisplay formatted block content dump along with interpretation.
-hDisplay help.
-iDisplay interpreted item details.
-kVerify block checksums.
-oDo not dump old values.
-R startblock [endblock]
Display specific block ranges within the file. Blocks are
indexed from 0. startblock: block to start
at. endblock: block to end at.
A startblock without
an endblock will format a single block.
-s segsize
Force segment size to segsize.
-tDump TOAST files.
-vOutput additional information about TOAST relations.
-n segnumber
Force segment number to segnumber.
-S blocksize
Force block size to blocksize.
-xForce interpreted formatting of block items as index items.
-yForce interpreted formatting of block items as heap items.
The following options are valid for control files:
-cInterpret the file listed as a control file.
-fDisplay formatted content dump along with interpretation.
-S blocksize
Force block size to blocksize.
Additional parameters:
-m
Interpret file as pg_filenode.map file and print contents.
All other options will be ignored.
In most cases, it is recommended to use the -i and
-f options to get the most useful dump output.
Patrick Macdonald <patrickm@redhat.com>