postgres restore & needed history files - Mailing list pgsql-general

From Zwettler Markus (OIZ)
Subject postgres restore & needed history files
Date
Msg-id 0ce7906d55174fa6902c011c0aa0e884@zuerich.ch
Whole thread Raw
Responses Re: postgres restore & needed history files
List pgsql-general

We are using a DIY Postgres backup:

---

psql -c "select pg_start_backup ('Full');"

save -s "${NSR_SERVER}" -g "${NSR_POOL}" "${PGDATA}"

psql -c "select pg_stop_backup();"

---

The pg_wal directory is not saved with it because it is a linked directory.

 

 

After some time, we had to perform a point-in-time recovery of 1 of the 5 databases to a point in time 7 days in the past.

We tried to perform a point-in-time restore on another host, which did not work until we copied the contents of the current pg_wal directory.

The current pg_wal directory included 8 history files: 00000002.history to 00000009.history.

The point-in-time restore worked smoodly after it had all these history files.

 

 

Afaik, all necessary history files should also be restored by the restore_command.

I had a look at our archived wal backups and found that 00000002.history to 00000008.history files already had been deleted due to our NSR backup retention of 30 days.

 

 

Question: Is it necessary to retain all history files?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

pgsql-general by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours
Next
From: Hao Zhang
Date:
Subject: Re: REINDEX vs VACUUM