pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Non text modes for pg_dumpall, correspondingly change pg_restore
Date: Fri, 04 Apr 2025 20:09:53 +0000
Message-ID: <E1u0nMP-002gkh-0E@gemulon.postgresql.org> (raw)

Non text modes for pg_dumpall, correspondingly change pg_restore

pg_dumpall acquires a new -F/--format option, with the same meanings as
pg_dump. The default is p, meaning plain text. For any other value, a
directory is created containing two files, globals.data and map.dat. The
first contains SQL for restoring the global data, and the second
contains a map from oids to database names. It will also contain a
subdirectory called databases, inside which it will create archives in
the specified format, named using the database oids.

In these casess the -f argument is required.

If pg_restore encounters a directory containing globals.dat, and no
toc.dat, it restores the global settings and then restores each
database.

pg_restore acquires two new options: -g/--globals-only which suppresses
restoration of any databases, and --exclude-database which inhibits
restoration of particualr database(s) in the same way the same option
works in pg_dumpall.

Author: Mahendra Singh Thalor <mahi6run@gmail.com>
Co-authored-by:  Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: jian he <jian.universality@gmail.com>
Reviewed-by: Srinath Reddy <srinath2133@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1495eff7bdb0779cc54ca04f3bd768f647240df2

Modified Files
--------------
doc/src/sgml/ref/pg_dumpall.sgml     |  86 +++-
doc/src/sgml/ref/pg_restore.sgml     |  66 ++-
src/bin/pg_dump/parallel.c           |  10 +
src/bin/pg_dump/pg_backup.h          |   2 +-
src/bin/pg_dump/pg_backup_archiver.c |  20 +-
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         | 294 +++++++++++--
src/bin/pg_dump/pg_restore.c         | 794 ++++++++++++++++++++++++++++++++++-
src/bin/pg_dump/t/001_basic.pl       |   9 +
11 files changed, 1201 insertions(+), 85 deletions(-)



view thread (10+ messages)  latest in thread

Message-ID: <E1u0nMP-002gkh-0E@gemulon.postgresql.org>
Permalink:  ../E1u0nMP-002gkh-0E@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u0nMP-002gkh-0E@gemulon.postgresql.org

 · 

reply

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: Non text modes for pg_dumpall, correspondingly change pg_restore
  In-Reply-To: <E1u0nMP-002gkh-0E@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