2011-01-18 02:28:26 +00:00
|
|
|
pg_filedump - Display formatted contents of a PostgreSQL heap, index,
|
|
|
|
or control file.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
Copyright (c) 2002-2010 Red Hat, Inc.
|
2011-01-18 02:28:26 +00:00
|
|
|
Copyright (c) 2011, PostgreSQL Global Development Group
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
Original Author: Patrick Macdonald <patrickm@redhat.com>
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
2011-01-18 02:28:26 +00:00
|
|
|
Overview:
|
|
|
|
|
|
|
|
pg_filedump is a utility to format PostgreSQL heap/index/control files
|
2011-01-18 01:33:27 +00:00
|
|
|
into a human-readable form. You can format/dump the files several ways,
|
|
|
|
as listed in the Invocation section, as well as dumping 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.
|
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
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.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
Some options may seem strange but they're there for a reason. For
|
|
|
|
example, block size. It's there because if the header of block 0 is
|
2011-01-18 02:28:26 +00:00
|
|
|
corrupt, you need a method of forcing a block size.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
------------------------------------------------------------------------
|
|
|
|
Compile/Installation:
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
To compile pg_filedump, you will need to have a properly configured
|
|
|
|
PostgreSQL source tree for the appropriate PostgreSQL major version.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
There are two makefiles included in this package. Makefile is a
|
|
|
|
standalone makefile for pg_filedump. Alter the PGSQL variable to point
|
|
|
|
to the PostgreSQL source tree. Makefile.contrib can be used if this
|
|
|
|
package was untarred in the contrib directory of a PostgreSQL build tree.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
make
|
|
|
|
make install (if in the contrib directory)
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
It is also possible to use Makefile.contrib without being in the contrib
|
|
|
|
directory:
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
make -f Makefile.contrib USE_PGXS=1
|
2011-01-18 01:33:27 +00:00
|
|
|
|
2011-01-18 02:28:26 +00:00
|
|
|
This will not eliminate the need to have a complete source tree, though.
|
2011-01-18 01:33:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
Invocation:
|
2011-01-18 02:28:26 +00:00
|
|
|
|
2011-01-18 01:33:27 +00:00
|
|
|
pg_filedump [-abcdfhixy] [-R startblock [endblock]] [-S blocksize] file
|
|
|
|
|
|
|
|
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 (Option will turn
|
|
|
|
off all formatting options)
|
|
|
|
-d Display formatted block content dump (Option will turn off
|
|
|
|
all other formatting options)
|
|
|
|
-f Display formatted block content dump along with interpretation
|
|
|
|
-h Display this information
|
|
|
|
-i Display interpreted item details
|
|
|
|
-R 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 the single block
|
|
|
|
-S 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 Force block size to [blocksize]
|