Re: pgbackrest question - Mailing list pgsql-admin

From Ron Johnson
Subject Re: pgbackrest question
Date
Msg-id CANzqJaD9sS2TfnPaN+OX8Zi6HQeFdP9D7u_apTw9HS8ziFAaLA@mail.gmail.com
Whole thread
List pgsql-admin
On Wed, Jul 22, 2026 at 10:49 PM Zechman, Derek S <Derek.S.Zechman@snapon.com> wrote:

I agree, why – what is the point of archiving wals outside of backup to a different location?  This is a general want to learn question and not a critque.  Thanks.  Thinking outloud – I would think you would want wals in the same location outside of backup


pgbackrest:
1. does not know about WALs that aren't in its directory structure, so can't use them, and
2. needs a full backup as a starting point.
 

so pgbackrest can restore to any time outside of the backup window for optimal point in time recovery.


This really confuses me.  You seem to be saying (i.e., my interpretation of what you wrote is) that pgbackrest can only restore to those narrow windows when pgbackrest is running a full, differential or incremental backup.  But that's just not true.

This, for example, restored an instance to  2024-08-13 19:00  even though no backup was running at that time:
readonly MajVer=17
readonly NewPGData=/path/to/${MajVer}/data
declare -i Threads=`nproc`-2
readonly BackupSet=20240811-010005F_20240813-000004I
readonly RestoreUntil="2024-08-13 19:00"

set -x
pgbackrest restore \
    --stanza=<stanza> \
    --log-level-file=detail \
    --log-level-console=detail \
    --process-max=${Threads} \
    --pg1-path=$NewPGData \
    --set=$BackupSet \
    --type=time --target="${RestoreUntil}" 
 
If I'm misunderstanding you, please clarify.

 

From: Ron Johnson <ronljohnsonjr@gmail.com>
Sent: Wednesday, July 22, 2026 4:22 PM
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: pgbackrest question

 

On Wed, Jul 22, 2026 at 4:13 PM Murthy Nunna <mnunna@fnal.gov> wrote: Hi, I am new to pgbackrest… Using pgbackrest is it possible to run a backup that includes WALs that spans the duration of the backup ONLY. I prefer to archive WALs outside

On Wed, Jul 22, 2026 at 4:13PM Murthy Nunna <mnunna@fnal.gov> wrote:

Hi,

 

I am new to pgbackrest… Using pgbackrest is it possible to run a backup that includes WALs that spans the duration of the backup ONLY. I prefer to archive WALs outside of pgbackrest for the routine archiving.

 

Why?  pgbackrest does a great job managing WALs and data backups, keeping everything consistent.

 

More importantly, during restore, pgbackrest assumes that all the WALs will be where it thinks they are.  Thus, while the backups might work, restores would fail.

 

And if that is possible, can I use such a backup for PITR by providing the required WALs that go beyond the backup duration?

 

This is something I can do today using pg_basebackup. I am looking to mimic this using pgbackrest.

 

pgbackrest is not pg_basebackup; do not try to make pgbackrest act like pg_basebackup.

 

--

Death to <Redacted>, and butter sauce.

Don't boil me, I'm still alive.

<Redacted> lobster!



--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Monitoring Streaming Replication
Next
From: Vani Majumdar
Date:
Subject: Subscription to community