pgsql: pg_restore: add --no-globals option to skip globals

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_restore: add --no-globals option to skip globals
Date: 2026-03-04 21:58:19
Message-ID: E1vxuEV-002PwN-15@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_restore: add --no-globals option to skip globals

This is a followup to commit 763aaa06f03 Add non-text output formats to
pg_dumpall.

Add a --no-globals option to pg_restore that skips restoring global
objects (roles and tablespaces) when restoring from a pg_dumpall
archive. When -C/--create is not specified, databases that do not
already exist on the target server are also skipped.

This is useful when restoring only specific databases from a pg_dumpall
archive without needing the global objects to be restored first.

Author: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>

With small tweaks by me.

Discussion: https://postgr.es/m/CAKYtNArdcc5kx1MdTtTKFNYiauo3=zCA-NB0LmBCW-RU_kSb3A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3c19983cc0816001ad849a9f0bcaf2ea8321b93d

Modified Files
--------------
doc/src/sgml/ref/pg_restore.sgml | 18 +++++++++++++++++-
src/bin/pg_dump/pg_restore.c | 30 ++++++++++++++++++++++++------
src/bin/pg_dump/t/001_basic.pl | 16 ++++++++++++++--
src/bin/pg_dump/t/007_pg_dumpall.pl | 21 ++++++++++++++++++++-
4 files changed, 75 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-03-04 22:34:49 Re: pgsql: Change default value of default_toast_compression to "lz4", when
Previous Message Andrew Dunstan 2026-03-04 21:12:04 pgsql: Improve writing map.dat preamble