postgreql-dump is used to dump and reload the whole PostgreSQL database when the database format has changed between releases and become incompatible. It tests for this situation by reading the version file in the top-level directory of the PostgreSQL database.
The trace of the program output is sent to standard output or standard error.
If there is an incompatibility between the database version of the current PostgreSQL programs and that of the database itself, this program must be used to dump the database to an ASCII file. (This may be a tape device.)
If the -d option is used, the entire contents of the database directory are then deleted. They may be preserved in another location, with the -p option, should you have both the desire and the spare disk capacity.
Specify the blocksize for writing the dump to target. This is only useful for output to a tape drive; it makes the script use dd to write to the target, instead of redirecting standard output.
After the dump has been written, copy it to screen through the filter named in PAGER (or more, by default) and ask the user to give confirmation before deleting the database files.
Destroy the database files after dumping the database. This option must be used when a new, incompatible release of PostgreSQL is loaded.
Force the default encoding to be encoding instead of its current value. This will not affect the encoding of existing databases, but will be used whenever a new database is created without a specific encoding's being specified.
Fix rules from earlier versions to the 6.5 (and later) standard. This filters the dump file through
Force an upgrade, even though the database version number is apparently up to date. This may be needed between beta releases that require an initdb even though the version number does not change.
Create a new database with initdb. This requires the option -d.
Load the dump into a new database. This option requires the -i option.
This option can only be used with -d. Instead of destroying the database files, the program moves them under directory, creating it, if necessary. Directory must not be the same directory as, or underneath the directory named in the environment variable, PGDATA.
This option is always required. Target is the file or tape to which the ASCII dump should be written. It is incorrect to name any physical device other than a tape. It is not possible (or, at least, meaningful) to use a tape with the -c option and also to start the dump in the middle of the tape. Target must not be the same directory as, or underneath the directory named in the environment variable, PGDATA.
Print more information about what the script is doing.
Prevents dumping the old database; use of this option overrides -x and -c. It is intended for use by the Debian post-installation script.