Skip to content

Commit e495a9a

Browse files
committed
minor improvement: parent TLI in FULL backups now always equal to zero
1 parent 5c751cb commit e495a9a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/show.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ show_instance_plain(parray *backup_list, bool show_name)
380380

381381
/* Current/Parent TLI */
382382
snprintf(row->tli, lengthof(row->tli), "%u / %u",
383-
backup->tli, get_parent_tli(backup->tli));
383+
backup->tli,
384+
backup->backup_mode == BACKUP_MODE_FULL ? 0 : get_parent_tli(backup->tli));
384385
widths[cur] = Max(widths[cur], strlen(row->tli));
385386
cur++;
386387

@@ -570,7 +571,7 @@ show_instance_json(parray *backup_list)
570571

571572
json_add_value(buf, "from-replica",
572573
backup->from_replica ? "true" : "false", json_level,
573-
false);
574+
true);
574575

575576
json_add_key(buf, "block-size", json_level);
576577
appendPQExpBuffer(buf, "%u", backup->block_size);
@@ -590,7 +591,12 @@ show_instance_json(parray *backup_list)
590591
appendPQExpBuffer(buf, "%d", backup->tli);
591592

592593
json_add_key(buf, "parent-tli", json_level);
593-
parent_tli = get_parent_tli(backup->tli);
594+
595+
/* Only incremental backup can have Parent TLI */
596+
if (backup->backup_mode == BACKUP_MODE_FULL)
597+
parent_tli = 0;
598+
else
599+
parent_tli = get_parent_tli(backup->tli);
594600
appendPQExpBuffer(buf, "%u", parent_tli);
595601

596602
snprintf(lsn, lengthof(lsn), "%X/%X",

0 commit comments

Comments
 (0)