August 30th, 2019
pg_dumpbinary is a program used to dump a PostgreSQL database with
data dumped in binary format. The resulting dump must be restored
using pg_restorebinary that is provided with this tool.
pg_dumpbinary 1.0 was released today, this release is the first public
release.
pg_dumpbinary is useful in some situations:
- you have bytea that can not be exported by pg_dump because the
total size of the escape/hex output exceed 1Gb. - you have custom type that stores
\0
internally in bytea but data
are returned as char/varchar/text which truncate data after
the '\0'. In this case pg_dump will export data in the output
type which will result in data lost. - any other case where pg_dump run in plain text, custom and
directory format is failing to export your data correctly.
If you are in this case pg_dumpbinary will help you by dumping the
PostgreSQL database in binary format. In all other cases you must
use the pg_dump/pg_restore commands distributed with PostgreSQL.
The program creates a directory with the name given as parameter for
the backup then it dump pre-data and post-data section using pg_dump
in this directory.
pg_dumpbinary use the SQL COPY command to dump and restore all
data in binary format from all tables. The COPY statement looks
like:
COPY my_table TO stdout WITH (FORMAT binary);
pg_dumpbinary creates consistent backups, the database server needs
to support synchronized snapshots, a feature that was introduced in
PG 9.2 for primary servers and 10 for standbys. pg_dumpbinary will
refuse to dump database that do not respect these minimum versions.
See documentation for a complete description of the features.
===== Links & Credits =====
pg_dumpbinary is an open project. Any contribution to build a better
tool is welcome. You just have to send your ideas, features requests
or patches using the GitHub tools.
Links :
- Documentation: https://github.com/lzlabs/pg_dumpbinary/blob/master/README.md
- Download: https://github.com/lzabs/pg_dumpbinary/releases/
- Support: use GitHub report tool at https://github.com/lzlabs/pg_dumpbinary/issues