pgsql: Add non-text output formats to pg_dumpall

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add non-text output formats to pg_dumpall
Date: 2026-02-26 13:34:05
Message-ID: E1vvbVF-001FkH-1g@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Co-Author: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reviewed-By: Tushar Ahuja <tushar(dot)ahuja(at)enterprisedb(dot)com>
Reviewed-By: Jian He <jian(dot)universality(at)gmail(dot)com>
Reviewed-By: Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>
Reviewed-By: Srinath Reddy <srinath2133(at)gmail(dot)com>

Discussion: https://postgr.es/m/cb103623-8ee6-4ba5-a2c9-f32e3a4933fa@dunslane.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/763aaa06f03401584d07db71256fc0ab47235cce

Modified Files
--------------
doc/src/sgml/ref/pg_dumpall.sgml | 113 ++++-
doc/src/sgml/ref/pg_restore.sgml | 119 +++++-
src/bin/pg_dump/meson.build | 1 +
src/bin/pg_dump/parallel.c | 14 +
src/bin/pg_dump/pg_backup.h | 2 +-
src/bin/pg_dump/pg_backup_archiver.c | 67 ++-
src/bin/pg_dump/pg_backup_archiver.h | 1 +
src/bin/pg_dump/pg_backup_tar.c | 2 +-
src/bin/pg_dump/pg_dump.c | 2 +-
src/bin/pg_dump/pg_dumpall.c | 801 +++++++++++++++++++++++++++++------
src/bin/pg_dump/pg_restore.c | 703 +++++++++++++++++++++++++++++-
src/bin/pg_dump/t/001_basic.pl | 55 +++
src/bin/pg_dump/t/007_pg_dumpall.pl | 639 ++++++++++++++++++++++++++++
src/tools/pgindent/typedefs.list | 1 +
14 files changed, 2354 insertions(+), 166 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Erik Rijkers 2026-02-26 14:16:22 typo in alter_table.sgml (was: Re: pgsql: Allow ALTER COLUMN SET EXPRESSION on virtual columns with CHECK)
Previous Message Álvaro Herrera 2026-02-26 12:51:29 pgsql: Reduce includes in pgstat.h