diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2025-04-04 10:05:38 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2025-04-04 16:01:22 -0400 |
commit | 1495eff7bdb0779cc54ca04f3bd768f647240df2 (patch) | |
tree | e4160823fd79737bf1d527da8eadf6f3f82570c6 /src/bin/pg_dump/parallel.c | |
parent | 2b69afbe50d5e39cc7d9703b3ab7acc4495a54ea (diff) | |
download | postgresql-1495eff7bdb0779cc54ca04f3bd768f647240df2.tar.gz postgresql-1495eff7bdb0779cc54ca04f3bd768f647240df2.zip |
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
Diffstat (limited to 'src/bin/pg_dump/parallel.c')
-rw-r--r-- | src/bin/pg_dump/parallel.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c index 086adcdc502..5974d6706fd 100644 --- a/src/bin/pg_dump/parallel.c +++ b/src/bin/pg_dump/parallel.c @@ -334,6 +334,16 @@ on_exit_close_archive(Archive *AHX) } /* + * When pg_restore restores multiple databases, then update already added entry + * into array for cleanup. + */ +void +replace_on_exit_close_archive(Archive *AHX) +{ + shutdown_info.AHX = AHX; +} + +/* * on_exit_nicely handler for shutting down database connections and * worker processes cleanly. */ |