Skip to content

Commit b0a63b6

Browse files
committed
Add -S, --slot option for backup with --stream
1 parent fb40b3e commit b0a63b6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

backup.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,11 +1508,13 @@ StreamLog(void *arg)
15081508
ctl.partial_suffix = NULL;
15091509
ctl.synchronous = false;
15101510
ctl.mark_done = false;
1511-
ReceiveXlogStream(conn, &ctl);
1511+
if(ReceiveXlogStream(conn, &ctl) == false)
1512+
elog(ERROR, "Problem in recivexlog");
15121513
#else
1513-
ReceiveXlogStream(conn, startpos, starttli, NULL, basedir,
1514+
if(ReceiveXlogStream(conn, startpos, starttli, NULL, basedir,
15141515
stop_streaming, standby_message_timeout, NULL,
1515-
false, false);
1516+
false, false) == false)
1517+
elog(ERROR, "Problem in recivexlog");
15161518
#endif
15171519

15181520
PQfinish(conn);

expected/option.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Backup options:
2525
--keep-data-generations=N keep GENERATION of full data backup
2626
--keep-data-days=DAY keep enough data backup to recover to DAY days age
2727
--backup-pg-log start backup pg_log directory
28+
-S, --slot=SLOTNAME replication slot to use
2829

2930
Restore options:
3031
--recovery-target-time time stamp up to which recovery will proceed

pg_arman.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static pgut_option options[] =
6666
{ 'b', 10, "backup-pg-log", &backup_logs },
6767
{ 'f', 'b', "backup-mode", opt_backup_mode, SOURCE_ENV },
6868
{ 'b', 'C', "smooth-checkpoint", &smooth_checkpoint, SOURCE_ENV },
69+
{ 's', 'S', "slot", &replication_slot, SOURCE_ENV },
6970
/* options with only long name (keep-xxx) */
7071
{ 'i', 1, "keep-data-generations", &keep_data_generations, SOURCE_ENV },
7172
{ 'i', 2, "keep-data-days", &keep_data_days, SOURCE_ENV },
@@ -242,6 +243,7 @@ pgut_help(bool details)
242243
printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n"));
243244
printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n"));
244245
printf(_(" --backup-pg-log start backup pg_log directory\n"));
246+
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
245247
printf(_("\nRestore options:\n"));
246248
printf(_(" --recovery-target-time time stamp up to which recovery will proceed\n"));
247249
printf(_(" --recovery-target-xid transaction ID up to which recovery will proceed\n"));

0 commit comments

Comments
 (0)