From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_restore: add --no-globals option to skip globals
Date: Wed, 04 Mar 2026 21:58:19 +0000
Message-ID: <E1vxuEV-002PwN-15@gemulon.postgresql.org> (raw)
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@gmail.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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: pg_restore: add --no-globals option to skip globals
In-Reply-To: <E1vxuEV-002PwN-15@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox