Skip to content

Commit 98c22ca

Browse files
committed
Updated documentation and test for --status option of delete command
1 parent a365520 commit 98c22ca

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

doc/pgprobackup.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3229,10 +3229,10 @@ pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replace
32293229
policy, without performing any irreversible actions.
32303230
</para>
32313231
<para>
3232-
To delete backups with the ERROR status, use the <option>--error-state</option> flag:
3232+
To delete all backups with some status, use the <option>--status</option>:
32333233
</para>
32343234
<programlisting>
3235-
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> --error-state
3235+
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> --status=ERROR
32363236
</programlisting>
32373237

32383238
</refsect2>
@@ -3869,7 +3869,7 @@ pg_probackup merge -B <replaceable>backup_dir</replaceable> --instance <replacea
38693869
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable>
38703870
[--help] [-j <replaceable>num_threads</replaceable>] [--progress]
38713871
[--retention-redundancy=<replaceable>redundancy</replaceable>][--retention-window=<replaceable>window</replaceable>][--wal-depth=<replaceable>wal_depth</replaceable>]
3872-
[--delete-wal] {-i <replaceable>backup_id</replaceable> | --delete-expired [--merge-expired] | --merge-expired | --error-state}
3872+
[--delete-wal] {-i <replaceable>backup_id</replaceable> | --delete-expired [--merge-expired] | --merge-expired | --status= }
38733873
[--dry-run]
38743874
[<replaceable>logging_options</replaceable>]
38753875
</programlisting>

src/util.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -488,22 +488,6 @@ BackupStatus
488488
str2status(const char *status)
489489
{
490490

491-
/* static const char *statusName[] =
492-
{
493-
"UNKNOWN",
494-
"OK",
495-
"ERROR",
496-
"RUNNING",
497-
"MERGING",
498-
"MERGED",
499-
"DELETING",
500-
"DELETED",
501-
"DONE",
502-
"ORPHAN",
503-
"CORRUPT"
504-
};*/
505-
506-
507491
for (int i = 0; i <= BACKUP_STATUS_CORRUPT; i++)
508492
{
509493
if (pg_strcasecmp(status, statusName[i]) == 0) return i;

tests/delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def test_delete_error_backups(self):
835835
self.assertEqual(len(show_backups), 4)
836836

837837
# delete error backups
838-
self.delete_pb(backup_dir, 'node', options=['--error-state'])
838+
self.delete_pb(backup_dir, 'node', options=['--status=ERROR'])
839839

840840
print(self.show_pb(backup_dir, as_text=True, as_json=False))
841841

0 commit comments

Comments
 (0)