Fix a couple of error messages and tests for them
authorAndrew Dunstan <[email protected]>
Fri, 4 Apr 2025 21:02:02 +0000 (17:02 -0400)
committerAndrew Dunstan <[email protected]>
Fri, 4 Apr 2025 21:07:45 +0000 (17:07 -0400)
oversights in 1495eff7bdb and 289f74d0cb2. Mea culpa.

src/bin/pg_dump/pg_restore.c
src/bin/pg_dump/t/001_basic.pl
src/bin/pg_dump/t/006_pg_dumpall.pl

index ce0c05e4b73af7bc2e1c3d7ee157f1bbf1693d80..aa2de8b516a7e594d194f5a546dfb5e378047060 100644 (file)
@@ -505,9 +505,9 @@ main(int argc, char **argv)
         * dump.
         */
        if (opts->tocSummary)
-           pg_fatal("option -l/--list cannot be used when restoring an archive created with pg_dumpall");
+           pg_fatal("option -l/--list cannot be used when restoring an archive created by pg_dumpall");
        else if (opts->tocFile)
-           pg_fatal("option -L/--use-list cannot be used when restoring an archive created with pg_dumpall");
+           pg_fatal("option -L/--use-list cannot be used when restoring an archive created by pg_dumpall");
 
        /*
         * To restore from a pg_dumpall archive, -C (create database) option
@@ -515,7 +515,7 @@ main(int argc, char **argv)
         */
        if (!globals_only && opts->createDB != 1)
        {
-           pg_log_error("-C/--create option should be specified when restoring from an archive of created by pg_dumpall");
+           pg_log_error("-C/--create option should be specified when restoring an archive created by pg_dumpall");
            pg_log_error_hint("Try \"%s --help\" for more information.", progname);
            pg_log_error_hint("Individual databases can be restored using their specific archives.");
            exit_nicely(1);
index 113a915bfbf26eb0becc385115d24fcbbbf3c989..84ca25e17d636b027f04fa2e2d1d647d4d3392e5 100644 (file)
@@ -244,12 +244,12 @@ command_fails_like(
 
 command_fails_like(
    [ 'pg_restore', '--exclude-database=foo', '-d', 'xxx', 'dumpdir' ],
-   qr/\Qpg_restore: error: option --exclude-database can be used only when restoring multiple databases by archive of pg_dumpall\E/,
+   qr/\Qpg_restore: error: option --exclude-database can be used only when restoring an archive created by pg_dumpall\E/,
    'When option --exclude-database is used in pg_restore with dump of pg_dump');
 
 command_fails_like(
    [ 'pg_restore', '--globals-only', '-d', 'xxx', 'dumpdir' ],
-   qr/\Qpg_restore: error: option -g\/--globals-only can be used only when restoring multiple databases by archive of pg_dumpall\E/,
+   qr/\Qpg_restore: error: option -g\/--globals-only can be used only when restoring an archive created by pg_dumpall\E/,
    'When option --globals-only is not used in pg_restore with dump of pg_dump');
 
 # also fails for -r and -t, but it seems pointless to add more tests for those.
index 44afdf525ff9dbe5a97e20d4f54191bd653c1e81..d6821c5615f2f67510f491007c30bd86a8fb42d0 100644 (file)
@@ -365,7 +365,7 @@ $node->command_fails_like(
     "$tempdir/format_custom",
     '--format' => 'custom',
     '--file' => "$tempdir/error_test.sql", ],
-    qr/\Qpg_restore: error: -C\/--create option should be specified when restoring multiple databases by archive of pg_dumpall\E/,
+    qr/\Qpg_restore: error: -C\/--create option should be specified when restoring an archive created by pg_dumpall\E/,
     'When -C is not used in pg_restore with dump of pg_dumpall');
 
 # test case 2: When --list option is used with dump of pg_dumpall
@@ -374,7 +374,7 @@ $node->command_fails_like(
        "$tempdir/format_custom", '-C',
        '--format' => 'custom', '--list',
        '--file' => "$tempdir/error_test.sql", ],
-   qr/\Qpg_restore: error: option -l\/--list cannot be used when restoring multiple databases by archive of pg_dumpall\E/,
+   qr/\Qpg_restore: error: option -l\/--list cannot be used when restoring an archive created by pg_dumpall\E/,
    'When --list is used in pg_restore with dump of pg_dumpall');
 
 # test case 3: When non-exist database is given with -d option