mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	Fix a couple of error messages and tests for them
oversights in1495eff7bdand289f74d0cb. Mea culpa.
This commit is contained in:
		| @@ -505,9 +505,9 @@ main(int argc, char **argv) | |||||||
| 		 * dump. | 		 * dump. | ||||||
| 		 */ | 		 */ | ||||||
| 		if (opts->tocSummary) | 		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) | 		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 | 		 * 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) | 		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("Try \"%s --help\" for more information.", progname); | ||||||
| 			pg_log_error_hint("Individual databases can be restored using their specific archives."); | 			pg_log_error_hint("Individual databases can be restored using their specific archives."); | ||||||
| 			exit_nicely(1); | 			exit_nicely(1); | ||||||
|   | |||||||
| @@ -244,12 +244,12 @@ command_fails_like( | |||||||
|  |  | ||||||
| command_fails_like( | command_fails_like( | ||||||
| 	[ 'pg_restore', '--exclude-database=foo', '-d', 'xxx', 'dumpdir' ], | 	[ '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'); | 	'When option --exclude-database is used in pg_restore with dump of pg_dump'); | ||||||
|  |  | ||||||
| command_fails_like( | command_fails_like( | ||||||
| 	[ 'pg_restore', '--globals-only', '-d', 'xxx', 'dumpdir' ], | 	[ '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'); | 	'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. | # also fails for -r and -t, but it seems pointless to add more tests for those. | ||||||
|   | |||||||
| @@ -365,7 +365,7 @@ $node->command_fails_like( | |||||||
|     "$tempdir/format_custom", |     "$tempdir/format_custom", | ||||||
|     '--format' => 'custom', |     '--format' => 'custom', | ||||||
|     '--file' => "$tempdir/error_test.sql", ], |     '--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'); |     '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 | # 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', | 		"$tempdir/format_custom", '-C', | ||||||
| 		'--format' => 'custom', '--list', | 		'--format' => 'custom', '--list', | ||||||
| 		'--file' => "$tempdir/error_test.sql", ], | 		'--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'); | 	'When --list is used in pg_restore with dump of pg_dumpall'); | ||||||
|  |  | ||||||
| # test case 3: When non-exist database is given with -d option | # test case 3: When non-exist database is given with -d option | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user