# postgres 12.2 defective backups



## PMc (Jun 13, 2020)

*Executive Summary: *Postgres 12 can loose data in backups, they may be faulty. Install 12.3 to fix.

This is serious, maybe I should have forwarded to here earlier, Our quarterly ports is currently still at 12.2 which has the problem. It may happen when the system goes down due to a power-loss, reset-switch or, in some cases, the "halt" or "reboot" command. It does not happen with orderly shutdown. 

In the problematic case, at restart postgres does recover, and then may delete the journal (aka WAL, aka redo-log, aka logical log, aka wtf) without saving it away. So if You save these journals to backup (which is called "continuous archiving", and is necessary for point-in-time-recovery), you will have a backup that is *broken*.

I noticed this, i.e. I noticed that I was lacking some logs after hardware maintenance, tracked it down to a database issue, and got confirmation in the mailinglist that it is a known issue. Should be fixed in 12.3.  

So, if You're dependent on such a backup scheme, then upgrade, check if your journals are complete and otherwise do a fresh base-backup.


----------

