pg_upgrade_check_mode_v1.diff
application/octet-stream
Filename: pg_upgrade_check_mode_v1.diff
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| src/bin/pg_upgrade/option.c | 7 | 0 |
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index 51fc7aede0..1663bcc3a2 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -63,6 +63,7 @@ parseCommandLine(int argc, char *argv[])
int option; /* Command line option */
int optindex = 0; /* used by getopt_long */
int os_user_effective_id;
+ int opt_num_transfer_mode = 0;
user_opts.do_sync = true;
user_opts.transfer_mode = TRANSFER_MODE_COPY;
@@ -131,6 +132,7 @@ parseCommandLine(int argc, char *argv[])
case 'k':
user_opts.transfer_mode = TRANSFER_MODE_LINK;
+ opt_num_transfer_mode++;
break;
case 'N':
@@ -193,10 +195,12 @@ parseCommandLine(int argc, char *argv[])
case 1:
user_opts.transfer_mode = TRANSFER_MODE_CLONE;
+ opt_num_transfer_mode++;
break;
case 2:
user_opts.transfer_mode = TRANSFER_MODE_COPY;
+ opt_num_transfer_mode++;
break;
default:
@@ -209,6 +213,9 @@ parseCommandLine(int argc, char *argv[])
if (optind < argc)
pg_fatal("too many command-line arguments (first is \"%s\")", argv[optind]);
+ if (opt_num_transfer_mode > 1)
+ pg_fatal("Only one transfer mode can be specified.");
+
if (log_opts.verbose)
pg_log(PG_REPORT, "Running in verbose mode");