]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_restore: add --no-globals option to skip globals
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 27 Feb 2026 13:07:10 +0000 (08:07 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 4 Mar 2026 21:53:29 +0000 (16:53 -0500)
commit3c19983cc0816001ad849a9f0bcaf2ea8321b93d
tree7551f8c4ad4a724c843f7378326f3cf6da9779e3
parentc7572cd48d393d16b57461cf954ae06c084ca2ee
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
doc/src/sgml/ref/pg_restore.sgml
src/bin/pg_dump/pg_restore.c
src/bin/pg_dump/t/001_basic.pl
src/bin/pg_dump/t/007_pg_dumpall.pl