Restore from postgres WAL

I’m reaching out to seek guidance on restoring my PostgreSQL database from a Write-Ahead Logging (WAL) backup with generated archive files. While I’m not experienced in database management, I’m facing a situation where I need to roll back changes made in the last three days while ensuring the integrity of my database, which has been in use for about five years.

Here’s my situation: my database isn’t corrupted, but I’ve encountered some issues with recent Data Definition Language (DDL) transactions that need to be recovered. I’ve heard about using WAL backups and archive files to restore databases, but I’m not sure how to go about it, especially when it comes to recovering specific transactions.

I’d greatly appreciate any advice, tips, or step-by-step instructions on how I can successfully restore my database to a specific point in time while ensuring that the recent DDL transactions are recovered properly. Any insights or experiences you can share would be incredibly helpful to me as I navigate this process.

Thank you in advance for your assistance and support!

please read PostgreSQL: Documentation: 16: 26.3. Continuous Archiving and Point-in-Time Recovery (PITR)
If you need professional help, we (CYBERTEC) could help you.

Wenn du kein Backup der Datenbankfiles hast, ist archiviertes WAL ziemlich nutzlos. WAL enthält nut die Daten um eine Transaktion zu wiederholen, nicht aber die Daten, um sie ungeschehen zu machen.

Wenn es um Änderungen an der Datenbankstruktur geht, ist die Frage, welche genau das waren. Wenn es keine zerstörenden Änderungen waren (z.B. DROP TABLE oder ALTER TABLE, bei dem die Tabelle neu geschrieben wird), und wenn VACUUM noch nicht die Metadatentabellen aufgeräumt hat, könnte ein Experte eventuell etwas machen.

Auf jeden Fall braucht man eine genaue Liste der DDL-Statements, die ausgeführt wurden.