Which PgBackRest policy for differential backups in PostgreSQL I set up pgBackRest and PostgreSQL configuration in two different servers.  

I set up with crontab one full backup a week and one differential backup a day.  

0  1   *   *   0     pgbackrest --type=full --stanza=stanzaname backup  
0  1   *   *   1-6   pgbackrest --type=diff --stanza=stanzaname backup


I set up retention as below to save disk usage:  

repo1-retention-full=2  
repo1-retention-diff=1
repo1-retention-archive-type=full


Is it possible to ensure PITR to cover up to 2 weeks with this retention configuration?  

If yes, is there a benefit to set a differential retention more than 1?
Because keeping more differential backups could consume a lot of disk space.
Depending on your archive (WAL) retention policy, maybe.


Nightly diffs: Relying solely on your nightly differential, your PITR recovery window would only go as far as last Sunday's full backup. From their docs, "Differential Backup: pgBackRest copies only those database cluster files that have changed since the last full backup". 

Let's say today it's Thursday Sept 19th, and that you want to recover up to last week's Tuesday (the 10th). You can't use your only differential, the one taken tonight (the 19th) at 1am, which only contains changes since the last full backup take on Sunday the 15th. If you restore your oldest full backup, the one taken on Sunday 8th, you have no differentials taken from Monday 9th until Sat 14th to apply to it.
WAL archives: So, can you use archived WAL files then, if you apply them after restoring the full backup taken on Sunday Sept 8th? Maybe - this is the part where I think the documentation is a bit unclear: "pgBackRest automatically removes archived WAL segments when expiring backups (the default expires WAL for full backups based on the repo1-retention-full option)".

I am not sure if they mean that last week's WALS are kept around or not; sounds like maybe yes, since the oldest full is not expired yet.. but the statement in brackets gives me some pause. 
Regardless of #2, my recommendation would be to find a solution that doesn't rely solely on WAL archive retention. You may either configure a higher retention for your nightly diffs so you don't need to rely solely on WAL archives (ideal but heavy on disk usage), or only do a full backup every 2 weeks (I don't like this option myself, since I prefer the peace of mind of a weekly full)

Or you can do what we do, nightly incrementals: "Incremental backups cannot be expired independently — they are always expired with their related full or differential backup."

To achieve the same PITR window of 14 days we are doing:


Sat 1am full backups, retention 2
Nightly incrementals from Sun-Fri



We find the above to be a good balance for us: the nightly incrementals are relatively small and are quicker than a differential, especially as we get farther from the Saturday full. 

Source: https://pgbackrest.org/user-guide.html (visited in 2019-09-19)