pg_filedump

pg_filedump — display formatted contents of a Postgres Pro heap, index, or control file

Synopsis

pg_filedump [option...] [file]

Description

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.

Installation

pg_filedump is provided with Postgres Pro as a separate pre-built package pg-filedump-ent-14 (for the detailed installation instructions, see Chapter 17).

Options

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:

-a

Display absolute addresses when formatting. Block header information is always block-relative.

-b

Display binary block images within a range. The option will turn off all formatting options.

-d

Display formatted block content dump. The option will turn off all other formatting options.

-D attrlist

Decode 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

-f

Display formatted block content dump along with interpretation.

-h

Display help.

-i

Display interpreted item details.

-k

Verify block checksums.

-o

Do 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.

-t

Dump TOAST files.

-v

Output additional information about TOAST relations.

-n segnumber

Force segment number to segnumber.

-S blocksize

Force block size to blocksize.

-x

Force interpreted formatting of block items as index items.

-y

Force interpreted formatting of block items as heap items.

The following options are valid for control files:

-c

Interpret the file listed as a control file.

-f

Display 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.

Author

Patrick Macdonald