Non text modes for pg_dumpall, correspondingly change pg_restore
Andrew Dunstan <andrew@dunslane.net>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/pg_dumpall.sgml | modified | +83 −3 |
| doc/src/sgml/ref/pg_restore.sgml | modified | +56 −10 |
| src/bin/pg_dump/parallel.c | modified | +10 −0 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +13 −7 |
| src/bin/pg_dump/pg_backup_archiver.h | modified | +1 −0 |
| src/bin/pg_dump/pg_backup.h | modified | +1 −1 |
| src/bin/pg_dump/pg_backup_tar.c | modified | +1 −1 |
| src/bin/pg_dump/pg_dumpall.c | modified | +249 −45 |
| src/bin/pg_dump/pg_dump.c | modified | +1 −1 |
| src/bin/pg_dump/pg_restore.c | modified | +777 −17 |
| src/bin/pg_dump/t/001_basic.pl | modified | +9 −0 |
Documentation touched
Discussion
- Non-text mode for pg_dumpall 217 messages · 2024-06-10 → 2026-06-18