mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	pg_upgrade: Add --copy option
This option selects the default transfer mode. Having an explicit option is handy to make scripts and tests more explicit. It also makes it easier to talk about a "copy" mode rather than "the default mode" or something like that, since until now the default mode didn't have an externally visible name. Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/50a97009-8ff9-ca4d-a0f6-6086a6775a5b%40enterprisedb.com
This commit is contained in:
		| @@ -230,6 +230,16 @@ PostgreSQL documentation | |||||||
|       </listitem> |       </listitem> | ||||||
|      </varlistentry> |      </varlistentry> | ||||||
|  |  | ||||||
|  |      <varlistentry> | ||||||
|  |       <term><option>--copy</option></term> | ||||||
|  |       <listitem> | ||||||
|  |        <para> | ||||||
|  |         Copy files to the new cluster.  This is the default.  (See also | ||||||
|  |         <option>--link</option> and <option>--clone</option>.) | ||||||
|  |        </para> | ||||||
|  |       </listitem> | ||||||
|  |      </varlistentry> | ||||||
|  |  | ||||||
|      <varlistentry> |      <varlistentry> | ||||||
|       <term><option>-?</option></term> |       <term><option>-?</option></term> | ||||||
|       <term><option>--help</option></term> |       <term><option>--help</option></term> | ||||||
|   | |||||||
| @@ -56,6 +56,7 @@ parseCommandLine(int argc, char *argv[]) | |||||||
| 		{"socketdir", required_argument, NULL, 's'}, | 		{"socketdir", required_argument, NULL, 's'}, | ||||||
| 		{"verbose", no_argument, NULL, 'v'}, | 		{"verbose", no_argument, NULL, 'v'}, | ||||||
| 		{"clone", no_argument, NULL, 1}, | 		{"clone", no_argument, NULL, 1}, | ||||||
|  | 		{"copy", no_argument, NULL, 2}, | ||||||
|  |  | ||||||
| 		{NULL, 0, NULL, 0} | 		{NULL, 0, NULL, 0} | ||||||
| 	}; | 	}; | ||||||
| @@ -194,6 +195,10 @@ parseCommandLine(int argc, char *argv[]) | |||||||
| 				user_opts.transfer_mode = TRANSFER_MODE_CLONE; | 				user_opts.transfer_mode = TRANSFER_MODE_CLONE; | ||||||
| 				break; | 				break; | ||||||
|  |  | ||||||
|  | 			case 2: | ||||||
|  | 				user_opts.transfer_mode = TRANSFER_MODE_COPY; | ||||||
|  | 				break; | ||||||
|  |  | ||||||
| 			default: | 			default: | ||||||
| 				fprintf(stderr, _("Try \"%s --help\" for more information.\n"), | 				fprintf(stderr, _("Try \"%s --help\" for more information.\n"), | ||||||
| 						os_info.progname); | 						os_info.progname); | ||||||
| @@ -283,6 +288,7 @@ usage(void) | |||||||
| 	printf(_("  -v, --verbose                 enable verbose internal logging\n")); | 	printf(_("  -v, --verbose                 enable verbose internal logging\n")); | ||||||
| 	printf(_("  -V, --version                 display version information, then exit\n")); | 	printf(_("  -V, --version                 display version information, then exit\n")); | ||||||
| 	printf(_("  --clone                       clone instead of copying files to new cluster\n")); | 	printf(_("  --clone                       clone instead of copying files to new cluster\n")); | ||||||
|  | 	printf(_("  --copy                        copy files to new cluster (default)\n")); | ||||||
| 	printf(_("  -?, --help                    show this help, then exit\n")); | 	printf(_("  -?, --help                    show this help, then exit\n")); | ||||||
| 	printf(_("\n" | 	printf(_("\n" | ||||||
| 			 "Before running pg_upgrade you must:\n" | 			 "Before running pg_upgrade you must:\n" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user