From 8b67f5ccedfe81bb5d859036e611dcd28e3a34d6 Mon Sep 17 00:00:00 2001 From: ebembi-crdb <169454390+ebembi-crdb@users.noreply.github.com> Date: Fri, 15 May 2026 14:58:12 +0530 Subject: [PATCH] ref-docs: add backup: add BEFORE/AFTER syntax to SHOW BACKUPS --- src/current/v26.1/show-backups.md | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/current/v26.1/show-backups.md diff --git a/src/current/v26.1/show-backups.md b/src/current/v26.1/show-backups.md new file mode 100644 index 00000000000..1591206c50e --- /dev/null +++ b/src/current/v26.1/show-backups.md @@ -0,0 +1,85 @@ +--- +title: backup: add BEFORE/AFTER syntax to SHOW BACKUPS +summary: Enhanced `SHOW BACKUPS` Documentation +toc: true +docs_area: reference +--- + +## Enhanced `SHOW BACKUPS` Documentation + +### Time filtering options + +The `SHOW BACKUPS` statement now supports optional time-based filtering to display backups created within specific time ranges. + +## Synopsis + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN location [AFTER timestamp] [BEFORE timestamp] +~~~ + +## Parameters + +| Parameter | Description | Required | +|-----------|-------------|----------| +| `location` | the backup collection location | Yes | +| `AFTER timestamp` | show only backups created after the specified timestamp | No | +| `BEFORE timestamp` | show only backups created before the specified timestamp | No | + +{{site.data.alerts.callout_info}} +The `AFTER` and `BEFORE` clauses can be used independently or combined. When both are specified, the order does not matter; `BEFORE timestamp AFTER timestamp` is equivalent to `AFTER timestamp BEFORE timestamp`. +{{site.data.alerts.end}} + +## Examples + +Show all backups in a collection: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN 's3://bucket/backup-collection'; +~~~ + +Show backups created after a specific timestamp: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN 's3://bucket/backup-collection' AFTER '2024-01-15 10:00:00'; +~~~ + +Show backups created before a specific timestamp: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN 's3://bucket/backup-collection' BEFORE '2024-01-20 18:30:00'; +~~~ + +Show backups created within a specific time range: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN 's3://bucket/backup-collection' AFTER '2024-01-15 10:00:00' BEFORE '2024-01-20 18:30:00'; +~~~ + +The time filter clauses accept the same order regardless of position: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN 's3://bucket/backup-collection' BEFORE '2024-01-20 18:30:00' AFTER '2024-01-15 10:00:00'; +~~~ + +Use with placeholders: + +{% include_cached copy-clipboard.html %} +~~~ sql +SHOW BACKUPS IN $1 AFTER $2 BEFORE $3; +~~~ + +## See also + +- [`BACKUP`]({% link {{ page.version.version }}/backup.md %}) +- [`SHOW BACKUP`]({% link {{ page.version.version }}/show-backup.md %}) +- [`RESTORE`]({% link {{ page.version.version }}/restore.md %}) + +--- + +This documentation addition covers the new time filtering functionality added to `SHOW BACKUPS`. The syntax supports flexible timestamp-based filtering that helps users narrow down backup listings to specific time periods, which is particularly useful for large backup collections.