Add non-text output formats to pg_dumpall
Andrew Dunstan <andrew@dunslane.net>
Add non-text output formats to pg_dumpall pg_dumpall can now produce output in custom, directory, or tar formats in addition to plain text SQL scripts. When using non-text formats, pg_dumpall creates a directory containing: - toc.glo: global data (roles and tablespaces) in custom format - map.dat: mapping between database OIDs and names - databases/: subdirectory with per-database archives named by OID pg_restore is extended to handle these pg_dumpall archives, restoring globals and then each database. The --globals-only option can be used to restore only the global objects. This enables parallel restore of pg_dumpall output and selective restoration of individual databases from a cluster-wide backup. Author: Mahendra Singh Thalor <mahi6run@gmail.com> Co-Author: Andrew Dunstan <andrew@dunslane.net> Reviewed-By: Tushar Ahuja <tushar.ahuja@enterprisedb.com> Reviewed-By: Jian He <jian.universality@gmail.com> Reviewed-By: Vaibhav Dalvi <vaibhav.dalvi@enterprisedb.com> Reviewed-By: Srinath Reddy <srinath2133@gmail.com> Discussion: https://postgr.es/m/cb103623-8ee6-4ba5-a2c9-f32e3a4933fa@dunslane.net
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/pg_dumpall.sgml | modified | +108 −5 |
| doc/src/sgml/ref/pg_restore.sgml | modified | +108 −11 |
| src/bin/pg_dump/meson.build | modified | +1 −0 |
| src/bin/pg_dump/parallel.c | modified | +14 −0 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +59 −8 |
| src/bin/pg_dump/pg_backup_archiver.h | modified | +1 −0 |
| src/bin/pg_dump/pg_backup.h | modified | +1 −1 |
| src/bin/pg_dump/pg_backup_tar.c | modified | +1 −1 |
| src/bin/pg_dump/pg_dumpall.c | modified | +679 −122 |
| src/bin/pg_dump/pg_dump.c | modified | +1 −1 |
| src/bin/pg_dump/pg_restore.c | modified | +686 −17 |
| src/bin/pg_dump/t/001_basic.pl | modified | +55 −0 |
| src/bin/pg_dump/t/007_pg_dumpall.pl | added | +639 −0 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Non-text mode for pg_dumpall 217 messages · 2024-06-10 → 2026-06-18