diff options
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 920569e4474..931e2013b89 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -2295,14 +2295,26 @@ main(int argc, char **argv) atexit(cleanup_directories_atexit); - while ((c = getopt_long(argc, argv, "CD:F:r:RS:t:T:X:l:nNzZ:d:c:h:p:U:s:wWvP", + while ((c = getopt_long(argc, argv, "c:Cd:D:F:h:l:nNp:Pr:Rs:S:t:T:U:vwWX:zZ:", long_options, &option_index)) != -1) { switch (c) { + case 'c': + if (pg_strcasecmp(optarg, "fast") == 0) + fastcheckpoint = true; + else if (pg_strcasecmp(optarg, "spread") == 0) + fastcheckpoint = false; + else + pg_fatal("invalid checkpoint argument \"%s\", must be \"fast\" or \"spread\"", + optarg); + break; case 'C': create_slot = true; break; + case 'd': + connection_string = pg_strdup(optarg); + break; case 'D': basedir = pg_strdup(optarg); break; @@ -2315,12 +2327,37 @@ main(int argc, char **argv) pg_fatal("invalid output format \"%s\", must be \"plain\" or \"tar\"", optarg); break; + case 'h': + dbhost = pg_strdup(optarg); + break; + case 'l': + label = pg_strdup(optarg); + break; + case 'n': + noclean = true; + break; + case 'N': + do_sync = false; + break; + case 'p': + dbport = pg_strdup(optarg); + break; + case 'P': + showprogress = true; + break; case 'r': maxrate = parse_max_rate(optarg); break; case 'R': writerecoveryconf = true; break; + case 's': + if (!option_parse_int(optarg, "-s/--status-interval", 0, + INT_MAX / 1000, + &standby_message_timeout)) + exit(1); + standby_message_timeout *= 1000; + break; case 'S': /* @@ -2330,15 +2367,24 @@ main(int argc, char **argv) replication_slot = pg_strdup(optarg); temp_replication_slot = false; break; - case 2: - no_slot = true; - break; case 't': backup_target = pg_strdup(optarg); break; case 'T': tablespace_list_append(optarg); break; + case 'U': + dbuser = pg_strdup(optarg); + break; + case 'v': + verbose++; + break; + case 'w': + dbgetpassword = -1; + break; + case 'W': + dbgetpassword = 1; + break; case 'X': if (strcmp(optarg, "n") == 0 || strcmp(optarg, "none") == 0) @@ -2359,18 +2405,6 @@ main(int argc, char **argv) pg_fatal("invalid wal-method option \"%s\", must be \"fetch\", \"stream\", or \"none\"", optarg); break; - case 1: - xlog_dir = pg_strdup(optarg); - break; - case 'l': - label = pg_strdup(optarg); - break; - case 'n': - noclean = true; - break; - case 'N': - do_sync = false; - break; case 'z': compression_algorithm = "gzip"; compression_detail = NULL; @@ -2380,45 +2414,11 @@ main(int argc, char **argv) backup_parse_compress_options(optarg, &compression_algorithm, &compression_detail, &compressloc); break; - case 'c': - if (pg_strcasecmp(optarg, "fast") == 0) - fastcheckpoint = true; - else if (pg_strcasecmp(optarg, "spread") == 0) - fastcheckpoint = false; - else - pg_fatal("invalid checkpoint argument \"%s\", must be \"fast\" or \"spread\"", - optarg); - break; - case 'd': - connection_string = pg_strdup(optarg); - break; - case 'h': - dbhost = pg_strdup(optarg); - break; - case 'p': - dbport = pg_strdup(optarg); - break; - case 'U': - dbuser = pg_strdup(optarg); - break; - case 'w': - dbgetpassword = -1; - break; - case 'W': - dbgetpassword = 1; - break; - case 's': - if (!option_parse_int(optarg, "-s/--status-interval", 0, - INT_MAX / 1000, - &standby_message_timeout)) - exit(1); - standby_message_timeout *= 1000; - break; - case 'v': - verbose++; + case 1: + xlog_dir = pg_strdup(optarg); break; - case 'P': - showprogress = true; + case 2: + no_slot = true; break; case 3: verify_checksums = false; |