=== Applying patches on top of PostgreSQL commit ID 9b0e5bd5320f95cfb35f0402c0f4bb7a1d3ecb0f === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Mar 5 06:51:23 UTC 2026 On branch cf/6541 nothing to commit, working tree clean === using 'git am' to apply patch ./v02-pg_restore-add-no-globals-option-to-skip-globals.patch === Applying: pg_restore: add --no-globals option to skip globals Using index info to reconstruct a base tree... M doc/src/sgml/ref/pg_restore.sgml M src/bin/pg_dump/pg_restore.c M src/bin/pg_dump/t/001_basic.pl Falling back to patching base and 3-way merge... Auto-merging src/bin/pg_dump/t/001_basic.pl CONFLICT (content): Merge conflict in src/bin/pg_dump/t/001_basic.pl Auto-merging src/bin/pg_dump/pg_restore.c CONFLICT (content): Merge conflict in src/bin/pg_dump/pg_restore.c Auto-merging doc/src/sgml/ref/pg_restore.sgml CONFLICT (content): Merge conflict in doc/src/sgml/ref/pg_restore.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 pg_restore: add --no-globals option to skip globals When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M doc/src/sgml/ref/pg_restore.sgml M src/bin/pg_dump/pg_restore.c M src/bin/pg_dump/t/001_basic.pl === using patch(1) to apply patch ./v02-pg_restore-add-no-globals-option-to-skip-globals.patch === patching file doc/src/sgml/ref/pg_restore.sgml Hunk #1 FAILED at 294. 1 out of 1 hunk FAILED -- saving rejects to file doc/src/sgml/ref/pg_restore.sgml.rej patching file src/bin/pg_dump/pg_restore.c Hunk #1 succeeded at 109 with fuzz 2 (offset 1 line). Hunk #2 succeeded at 174 (offset 2 lines). Hunk #3 succeeded at 497 with fuzz 2 (offset 6 lines). Hunk #4 FAILED at 620. Hunk #5 FAILED at 632. Hunk #6 succeeded at 848 with fuzz 1 (offset 11 lines). Hunk #7 FAILED at 1356. 3 out of 7 hunks FAILED -- saving rejects to file src/bin/pg_dump/pg_restore.c.rej patching file src/bin/pg_dump/t/001_basic.pl Hunk #1 FAILED at 299. 1 out of 1 hunk FAILED -- saving rejects to file src/bin/pg_dump/t/001_basic.pl.rej Unstaged changes after reset: M src/bin/pg_dump/pg_restore.c Removing doc/src/sgml/ref/pg_restore.sgml.rej Removing src/bin/pg_dump/pg_restore.c.rej Removing src/bin/pg_dump/t/001_basic.pl.rej === using 'git apply' to apply patch ./v02-pg_restore-add-no-globals-option-to-skip-globals.patch === Applied patch to 'doc/src/sgml/ref/pg_restore.sgml' with conflicts. Applied patch to 'src/bin/pg_dump/pg_restore.c' with conflicts. Applied patch to 'src/bin/pg_dump/t/001_basic.pl' with conflicts. U doc/src/sgml/ref/pg_restore.sgml U src/bin/pg_dump/pg_restore.c U src/bin/pg_dump/t/001_basic.pl diff --cc doc/src/sgml/ref/pg_restore.sgml index c7ed947968c,1921c97b725..00000000000 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@@ -300,17 -300,15 +300,29 @@@ PostgreSQL documentatio ++<<<<<<< ours + + + + + Do not restore global objects (roles and tablespaces). When + / is not specified, + databases that do not already exist on the target server are skipped. + + + This option is only relevant when restoring from a non-plain-text + archive made using pg_dumpall. ++======= + + + + + Do not restore global objects (roles and tablespaces) and even don't create new database if + or is not specified. + + + This option is only relevant when restoring from a non-plain-text archive made using pg_dumpall. ++>>>>>>> theirs diff --cc src/bin/pg_dump/pg_restore.c index 752d859e264,8810f9215d4..00000000000 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@@ -107,8 -107,8 +107,9 @@@ main(int argc, char **argv static int no_schema = 0; static int no_security_labels = 0; static int no_statistics = 0; + static int no_globals = 0; static int no_subscriptions = 0; + static int no_globals = 0; static int strict_names = 0; static int statistics_only = 0; static int with_statistics = 0; @@@ -493,7 -493,7 +495,11 @@@ if (no_globals && globals_only) pg_fatal("options %s and %s cannot be used together", ++<<<<<<< ours + "--no-globals", "-g/--globals-only"); ++======= + "--no-globals", "-g/--globals-only"); ++>>>>>>> theirs /* * -C is not compatible with -1, because we can't create a database inside @@@ -621,7 -621,7 +627,11 @@@ /* * To restore from a pg_dumpall archive, -C (create database) option * must be specified unless we are only restoring globals or we are ++<<<<<<< ours + * skipping globals. ++======= + * skiping globals. ++>>>>>>> theirs */ if (!no_globals && !globals_only && opts->createDB != 1) { @@@ -633,16 -633,17 +643,27 @@@ } /* ++<<<<<<< ours + * Restore global objects, even if --exclude-database results in zero + * databases to process. If 'globals-only' is set, exit immediately. ++======= + * Restore global objects, even if --exclude-database results + * in zero databases to process. If 'globals-only' is set, exit + * immediately. ++>>>>>>> theirs */ snprintf(global_path, MAXPGPATH, "%s/toc.glo", inputFileSpec); if (!no_globals) n_errors = restore_global_objects(global_path, tmpopts); else ++<<<<<<< ours + pg_log_info("skipping restore of global objects because %s was specified", + "--no-globals"); ++======= + pg_log_info("toc.glo(globals) restoring skipped because option %s is specified", + "--no-globals"); ++>>>>>>> theirs if (globals_only) pg_log_info("database restoring skipped because option %s was specified", @@@ -839,9 -840,9 +860,10 @@@ usage(const char *progname printf(_(" --no-security-labels do not restore security labels\n")); printf(_(" --no-statistics do not restore statistics\n")); printf(_(" --no-subscriptions do not restore subscriptions\n")); + printf(_(" --no-globals do not restore global objects (roles and tablespaces)\n")); printf(_(" --no-table-access-method do not restore table access methods\n")); printf(_(" --no-tablespaces do not restore tablespace assignments\n")); + printf(_(" --no-globals do not restore global objects (roles and tablespaces)\n")); printf(_(" --restrict-key=RESTRICT_KEY use provided string as psql \\restrict key\n")); printf(_(" --section=SECTION restore named section (pre-data, data, or post-data)\n")); printf(_(" --statistics restore the statistics\n")); @@@ -1362,8 -1363,8 +1384,13 @@@ restore_all_databases(const char *input { if (!tmpopts->createDB) { ++<<<<<<< ours + pg_log_info("skipping restore of database \"%s\": database does not exist and %s was not specified", + dbidname->str, "-C/--create"); ++======= + pg_log_info("database %s restoring skipped because options %s and %s=false are specified with dump of pg_dumpall", + dbidname->str, "--no-globals", "-C/--create" ); ++>>>>>>> theirs continue; } diff --cc src/bin/pg_dump/t/001_basic.pl index 930ef4915c5,e2d6b30e437..00000000000 --- a/src/bin/pg_dump/t/001_basic.pl +++ b/src/bin/pg_dump/t/001_basic.pl @@@ -305,10 -301,8 +305,17 @@@ command_fails_like ); command_fails_like( ++<<<<<<< ours + [ + 'pg_restore', '--globals-only', '--no-globals', '-d', 'xxx', + 'dumpdir' + ], + qr/\Qpg_restore: error: options --no-globals and -g\/--globals-only cannot be used together\E/, + 'options --no-globals and --globals-only cannot be used together'); ++======= + [ 'pg_restore', '--globals-only', '--no-globals', '-d', 'xxx', 'dumpdir' ], + qr/\Qpg_restore: error: options --no-globals and -g\/--globals-only cannot be used together\E/, + 'pg_restore: error: options --no-globals and -g/--globals-only cannot be used together' + ); ++>>>>>>> theirs done_testing();