pg_restore add --no-globals option when restored using pg_dumpall non-text dump

From: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: pg_restore add --no-globals option when restored using pg_dumpall non-text dump
Date: 2026-02-27 06:27:48
Message-ID: CAKYtNAoZUkX2qJsTf73P1zCnh9sVJ7PDtthN3i0wZCTLiBsxMg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Recently we committed a patch to dump a full cluster with pg_dumpall in
non-text archive format and then restore using pg_restore.
Here, I am proposing a patch to add the "pg_restore --no-globals" option so
that users can skip global objects.

I made a patch for pg_restore --no-globals (only pg_restore option, not
needed with pg_dumpall as we will filter at restore end, or later we can
add for pg_dumpall also.)

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

Do not restore global objects (roles and tablespaces) and even don't
create new database if
--create or -C is not specified.
Note: database will be created only if -C is specified, otherwise
restore will be skipped for a particular database. If a db is already
created, then data of a particular db will be restored.

Please review this patch and let me know your feedback.

--
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v01-pg_restore-add-no-globals-option-to-skip-globals.patch application/octet-stream 6.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2026-02-27 06:33:21 Re: POC: make mxidoff 64 bits
Previous Message Chao Li 2026-02-27 06:04:30 Re: Use pg_icu_unicode_version(void) instead of pg_icu_unicode_version()